Re: [Linuxwacom-devel] [PATCH libwacom] data: Add Dell Canvas 27

2017-11-03 Thread Jason Gerecke
On November 3, 2017 7:01:36 AM PDT, Benjamin Tissoires 
 wrote:
>The touchscreen part is not from Wacom, so we need to
>teach libwacom and libinput that both are part of the
>same device group for them to do touch arbitration.
>
>Signed-off-by: Benjamin Tissoires 
>---
>data/dell-canvas-27.tablet | 40
>
> 1 file changed, 40 insertions(+)
> create mode 100644 data/dell-canvas-27.tablet
>
>diff --git a/data/dell-canvas-27.tablet b/data/dell-canvas-27.tablet
>new file mode 100644
>index 000..eacc21f
>--- /dev/null
>+++ b/data/dell-canvas-27.tablet
>@@ -0,0 +1,40 @@
>+# Dell
>+# Canvas 27
>+# 
>+#
>+#
>+#  *---*
>+#  |   |
>+#  |   |
>+#  |   |
>+#  |   |
>+#  |   |
>+#  |DISPLAY|
>+#  |   |
>+#  |   |
>+#  |   |
>+#  |   |
>+#  |   |
>+#  *---*
>+#
>+
>+[Device]
>+Name=Dell Canvas 27
>+Class=Cintiq
>+DeviceMatch=usb:056a:4200
>+PairedID=usb:2575:0204
>+Width=23
>+Height=13
>+# No pad buttons, so no layout
>+
>+# not having 0x80a (an Eraser) makes g-s-d crashes prior 3.26 (3.22 at
>least)
>+# so add this dummy stylus that will not show up in g-c-c

Yikes. I know Ubuntu's fork of g-c-c had issues with eraser-less pens but I 
thought that was fixed some time ago. Wonder if the latest (non-pro) Intuos 
causes this same crash...

Acked-by: Jason Gerecke 

>+Styli=0xd;0x80a;
>+IntegratedIn=Display
>+
>+[Features]
>+Stylus=true
>+Reversible=false
>+Touch=true
>+Ring=false
>+Buttons=0


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/2] Process 24HDT and 27QHDT in wacom_multitouch_generic

2017-11-03 Thread Ping Cheng
On Friday, November 3, 2017, Jason Gerecke  wrote:

> The wacom_multitouch_generic function was based upon wacom_24hdt_irq
> and can be fairly trivially swapped in to its place. By doing this, we
> can bring more functionality under one common umbrella that is available
> in every kernel tree (wacom_24hdt_irq itself was never backported to
> 2.6.30/2.6.36).
>
> Signed-off-by: Jason Gerecke >


Acked-by: Ping Cheng 

Ping

---
>  2.6.30/wacom_wac.c |   5 +-
>  2.6.36/wacom_wac.c |   5 +-
>  2.6.38/wacom_wac.c | 137 +-
> ---
>  3.7/wacom_wac.c| 135 +-
> --
>  4 files changed, 110 insertions(+), 172 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 1484a1a..b110a7d 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -964,11 +964,10 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> int x = -1;
> int y = -1;
> int prox = -1;
> -   int offset;
> +   int offset = bytes_per_packet * i + bytes_header;
>
> switch (features->type) {
> case WACOM_MSPROT:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> @@ -976,7 +975,6 @@ static int wacom_multitouch_generic(struct wacom_wac
> *wacom)
> break;
>
> case INTUOSP2:
> -   offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> x = get_unaligned_le16([offset + 2]);
> @@ -984,7 +982,6 @@ static int wacom_multitouch_generic(struct wacom_wac
> *wacom)
> break;
>
> case DTH1152T:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> index 1d5ee35..cc76104 100644
> --- a/2.6.36/wacom_wac.c
> +++ b/2.6.36/wacom_wac.c
> @@ -1315,11 +1315,10 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> int x = -1;
> int y = -1;
> int prox = -1;
> -   int offset;
> +   int offset = bytes_per_packet * i + bytes_header;
>
> switch (features->type) {
> case WACOM_MSPROT:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> @@ -1327,7 +1326,6 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> break;
>
> case INTUOSP2:
> -   offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> x = get_unaligned_le16([offset + 2]);
> @@ -1335,7 +1333,6 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> break;
>
> case DTH1152T:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index d6797a5..8c0c1d7 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -1142,7 +1142,8 @@ static int wacom_wac_finger_count_touches(struct
> wacom_wac *wacom)
>
>  static void wacom_multitouch_generic_finger(struct wacom_wac *wacom,
> int contact_id, bool prox,
> -   int x, int y, int w, int h)
> +   int x, int y, int w, int h,
> +   int c_x, int c_y)
>  {
> struct input_dev *input = wacom->input;
> int slot = find_slot_from_contactid(wacom, contact_id);
> @@ -1163,6 +1164,12 @@ static void wacom_multitouch_generic_finger(struct
> wacom_wac *wacom,
> input_report_abs(input, ABS_MT_TOUCH_MAJOR, max(w,
> h));
> input_report_abs(input, ABS_MT_TOUCH_MINOR, min(w,
> h));
> 

Re: [Linuxwacom-devel] [PATCH input-wacom] Correct tilt range for MobileStudio/Intuos/Cintiq Pro devices

2017-11-03 Thread Ping Cheng
On Friday, November 3, 2017, Jason Gerecke  wrote:

> The pre-3.17 kernels set up their tilt axis ranges to be 0..127 rather
> than -64..+63 like with the HID kernels. We need to add a correction for
> this to the wacom_mspro_pen_irq function so that userspace properly
> interprets the data. Without this fix, any physical tilt angle will be
> interprted as being to the upper-left (and any amount of actual up/left
> tilt angle will be saturated at -64 degrees).
>
> Fixes: cd79aac597 ("backport: MobileStudio Pro to 3.7, 2.6.38, 2.6.36,
> 2.6.30")
> Signed-off-by: Jason Gerecke >


Acked-by: Ping Cheng 

Ping


> ---
>  2.6.30/wacom_wac.c | 4 
>  2.6.36/wacom_wac.c | 4 
>  2.6.38/wacom_wac.c | 4 
>  3.7/wacom_wac.c| 4 
>  4 files changed, 16 insertions(+)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index ae3e1b4..1484a1a 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -1653,6 +1653,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> index 85683d6..1d5ee35 100644
> --- a/2.6.36/wacom_wac.c
> +++ b/2.6.36/wacom_wac.c
> @@ -1490,6 +1490,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index 0b8b15f..d6797a5 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -1953,6 +1953,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
> index 08d375e..cde8d22 100644
> --- a/3.7/wacom_wac.c
> +++ b/3.7/wacom_wac.c
> @@ -1933,6 +1933,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> --
> 2.15.0
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH xf86-input-wacom] conf: add Dell Canvas 27 touch

2017-11-03 Thread Jason Gerecke
On November 3, 2017 2:23:10 PM PDT, Benjamin Tissoires 
 wrote:
>On Fri, Nov 3, 2017 at 9:15 PM, Aaron Armstrong Skomra
> wrote:
>>
>>
>> On Fri, Nov 3, 2017 at 7:19 AM, Benjamin Tissoires
>>  wrote:
>>>
>>> The Dell canvas 27 is an external monitor with pen and touch, but
>the
>>> pen is provided by Wacom, and the touch by Advanced Silicon.
>>> To have proper touch arbitration, we need to force xf86-input-wacom
>>> to also handle the touch part.
>>>
>>> Signed-off-by: Benjamin Tissoires 
>>> ---
>>>  conf/70-wacom.conf | 9 +
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/conf/70-wacom.conf b/conf/70-wacom.conf
>>> index a20e3a3..86a3f90 100644
>>> --- a/conf/70-wacom.conf
>>> +++ b/conf/70-wacom.conf
>>> @@ -101,3 +101,12 @@ Section "InputClass"
>>> Driver "wacom"
>>> Option "Button2" "3"
>>>  EndSection
>>> +
>>> +# Dell Canvas 27 (touch part is an Advanced Silicon, pen part a
>Wacom)
>>> +Section "InputClass"
>>> +Identifier "Dell Canvas 27 Touch"
>>> +MatchUSBID "2575:0204"
>>> +MatchDevicePath "/dev/input/event*"
>>> +MatchIsTouchscreen "true"
>>> +Driver "wacom"
>>> +EndSection
>>> --
>>

Patch looks sensible enough:

Reviewed-By: Jason Gerecke 

>>
>>
>> HI Benjamin,
>>
>> I know that the last display device that I added support for required
>> changes to wcmUSB.c and
>> wcmValidateDevice.c [1] for Centos 6.
>
>Oh... I thought the xorg wacom driver was now smart enough to not
>require such changes...
>

The driver can auto detect most of this stuff, but some data is not available 
from the RHEL6 kernel (off the top of my head, the axis resolution and 
touchscreen/touchpad prop). An entry would need to be added for full 
compatibility.

That said, the situation is somewhat moot on RHEL6 since there isn't yet an 
input-wacom or kernel patch to support the pen. Until such a patch comes into 
existence, users can just remove this xorg.conf.d option to have the evdev 
driver control the touchscreen instead.

>>
>> I'm not very familiar with the x driver conf files, so it may be that
>this
>> also accomplishes
>> the same thing by another means.
>
>I'd say it's different. Here my patch just forces the Advanced Silicon
>touchscreen to be handled by xf86-input-wacom so the xorg driver can
>do touch arbitration.
>Your patch tweaks the tablet so that it is usable from the application
>point of view.
>We might need such changes also :/
>
>> If you're just aiming for Centos 7 support,
>> or if you know
>> this conf file also works for Centos 6 this seems fine. Otherwise the
>driver
>> probably needs changes
>> similar to the commit below to support this device. If you'd like me
>to work
>> on that, let me know and I'll
>> see if I can find a device.
>
>I'd be happy if you could have a look at the device itself. Note that
>you need a kernel patch for it to report accurate coordinates [2].
>But one solution could be to teach me what to check and I'll assess
>myself if we need changes in those files too.
>
>BTW, from my engineer point of view, I doubt we will be able to
>officially support it in CentOS 6. This requires a change in the
>kernel that depends on too many others (basically the whole HID
>stack). But this is not a Red Hat statement, just my wish that we
>should push back any request coming for this device on RHEL 6 :)
>

There's also the option of having an existing/new IRQ function in wacom_wac.c 
decode the reports without the benefit of HID like we currently do for such old 
input-wacom backports. Of course, it's fine to not bother with that until it 
becomes necessary.

Tangentially, I'd like data for this pair of devices added to the 
wacom-hid-descriptors repository. The sysinfo.sh script should be updated to 
detect the touch VID:PID first though.

Jason

>Cheers,
>Benjamin
>
>[2] https://patchwork.kernel.org/patch/10040899/
>
>>
>> Best,
>> Aaron
>>
>> [1]
>>
>https://sourceforge.net/p/linuxwacom/xf86-input-wacom/ci/b0a055425dfb983163b1d3c673a36aebf9536430/
>>>
>>> 2.13.6
>>>
>>>
>>>
>>>
>--
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> ___
>>> Linuxwacom-devel mailing list
>>> Linuxwacom-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>>
>>


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net

[Linuxwacom-devel] [PATCH input-wacom 2/2] Add support for WACOM_24HDT and WACOM_27QHDT touch sensors to 2.6.30 / 2.6.36

2017-11-03 Thread Jason Gerecke
Following up on the prior patch, we add the code necessary for the 2.6.30
and 2.6.36 trees to properly handle touch sensors from the WACOM_24HDT and
WACOM_27QHDT classes (e.g. Cintiq 24HDT, Cintiq 13HDT, DTH2242).

Signed-off-by: Jason Gerecke 
---
 2.6.30/wacom_sys.c | 50 +++---
 2.6.30/wacom_wac.c | 70 +++---
 2.6.30/wacom_wac.h |  5 
 2.6.36/wacom_sys.c | 46 +++
 2.6.36/wacom_wac.c | 68 
 2.6.36/wacom_wac.h |  4 
 6 files changed, 229 insertions(+), 14 deletions(-)

diff --git a/2.6.30/wacom_sys.c b/2.6.30/wacom_sys.c
index b8c048a..92da296 100644
--- a/2.6.30/wacom_sys.c
+++ b/2.6.30/wacom_sys.c
@@ -263,17 +263,22 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
 features->type == 
MTTPC ||
 features->type == 
MTTPC_B ||
 features->type == 
MTTPC_C ||
+features->type == 
WACOM_24HDT ||
 features->type == 
WACOM_MSPROT ||
-features->type == 
DTH1152T) {
+features->type == 
DTH1152T ||
+features->type == 
WACOM_27QHDT) {
/* need to reset back */
features->pktlen = 
WACOM_PKGLEN_TPC2FG;
if (features->type == MTTPC ||
features->type == MTTPC_B ||
features->type == MTTPC_C)
features->pktlen = 
WACOM_PKGLEN_MTTPC;
+   else if (features->type == 
WACOM_24HDT)
+   features->pktlen = 
WACOM_PKGLEN_MTOUCH;
else if (features->type == 
WACOM_MSPROT)
features->pktlen = 
WACOM_PKGLEN_MSPROT;
-   else if (features->type == 
DTH1152T)
+   else if (features->type == 
DTH1152T ||
+features->type == 
WACOM_27QHDT)
features->pktlen = 
WACOM_PKGLEN_27QHDT;
features->device_type = 
BTN_TOOL_TRIPLETAP;
}
@@ -290,6 +295,7 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
break;
 
case DTH1152T:
+   case WACOM_24HDT:
features->x_max =

get_unaligned_le16([i + 3]);
features->x_phy =
@@ -298,6 +304,17 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
features->unitExpo = report[i - 
3];
break;
 
+   case WACOM_27QHDT:
+   if (!features->x_max) {
+   features->x_max =
+   
get_unaligned_le16([i - 4]);
+   features->x_phy =
+   
get_unaligned_le16([i - 7]);
+   features->unit = 
report[i - 13];
+   features->unitExpo = 
report[i - 11];
+   }
+   break;
+
case WACOM_MSPROT:
case MTTPC_B:
features->x_max =
@@ -351,6 +368,7 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
break;
 
case DTH1152T:
+   case WACOM_24HDT:
case MTTPC_C:
 

[Linuxwacom-devel] [PATCH input-wacom 1/2] Process 24HDT and 27QHDT in wacom_multitouch_generic

2017-11-03 Thread Jason Gerecke
The wacom_multitouch_generic function was based upon wacom_24hdt_irq
and can be fairly trivially swapped in to its place. By doing this, we
can bring more functionality under one common umbrella that is available
in every kernel tree (wacom_24hdt_irq itself was never backported to
2.6.30/2.6.36).

Signed-off-by: Jason Gerecke 
---
 2.6.30/wacom_wac.c |   5 +-
 2.6.36/wacom_wac.c |   5 +-
 2.6.38/wacom_wac.c | 137 +
 3.7/wacom_wac.c| 135 +---
 4 files changed, 110 insertions(+), 172 deletions(-)

diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
index 1484a1a..b110a7d 100644
--- a/2.6.30/wacom_wac.c
+++ b/2.6.30/wacom_wac.c
@@ -964,11 +964,10 @@ static int wacom_multitouch_generic(struct wacom_wac 
*wacom)
int x = -1;
int y = -1;
int prox = -1;
-   int offset;
+   int offset = bytes_per_packet * i + bytes_header;
 
switch (features->type) {
case WACOM_MSPROT:
-   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
prox = data[offset] & 0x1;
contact_id = get_unaligned_le16([offset + 1]);
x = get_unaligned_le16([offset + 3]);
@@ -976,7 +975,6 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
break;
 
case INTUOSP2:
-   offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
contact_id = data[offset];
prox = data[offset + 1] & 0x01;
x = get_unaligned_le16([offset + 2]);
@@ -984,7 +982,6 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
break;
 
case DTH1152T:
-   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
prox = data[offset] & 0x1;
contact_id = get_unaligned_le16([offset + 1]);
x = get_unaligned_le16([offset + 3]);
diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
index 1d5ee35..cc76104 100644
--- a/2.6.36/wacom_wac.c
+++ b/2.6.36/wacom_wac.c
@@ -1315,11 +1315,10 @@ static int wacom_multitouch_generic(struct wacom_wac 
*wacom)
int x = -1;
int y = -1;
int prox = -1;
-   int offset;
+   int offset = bytes_per_packet * i + bytes_header;
 
switch (features->type) {
case WACOM_MSPROT:
-   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
prox = data[offset] & 0x1;
contact_id = get_unaligned_le16([offset + 1]);
x = get_unaligned_le16([offset + 3]);
@@ -1327,7 +1326,6 @@ static int wacom_multitouch_generic(struct wacom_wac 
*wacom)
break;
 
case INTUOSP2:
-   offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
contact_id = data[offset];
prox = data[offset + 1] & 0x01;
x = get_unaligned_le16([offset + 2]);
@@ -1335,7 +1333,6 @@ static int wacom_multitouch_generic(struct wacom_wac 
*wacom)
break;
 
case DTH1152T:
-   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
prox = data[offset] & 0x1;
contact_id = get_unaligned_le16([offset + 1]);
x = get_unaligned_le16([offset + 3]);
diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
index d6797a5..8c0c1d7 100644
--- a/2.6.38/wacom_wac.c
+++ b/2.6.38/wacom_wac.c
@@ -1142,7 +1142,8 @@ static int wacom_wac_finger_count_touches(struct 
wacom_wac *wacom)
 
 static void wacom_multitouch_generic_finger(struct wacom_wac *wacom,
int contact_id, bool prox,
-   int x, int y, int w, int h)
+   int x, int y, int w, int h,
+   int c_x, int c_y)
 {
struct input_dev *input = wacom->input;
int slot = find_slot_from_contactid(wacom, contact_id);
@@ -1163,6 +1164,12 @@ static void wacom_multitouch_generic_finger(struct 
wacom_wac *wacom,
input_report_abs(input, ABS_MT_TOUCH_MAJOR, max(w, h));
input_report_abs(input, ABS_MT_TOUCH_MINOR, min(w, h));
input_report_abs(input, ABS_MT_ORIENTATION, w > h);
+
+   if (c_x >= 0 && c_y >= 0) {
+   input_report_abs(input, ABS_MT_WIDTH_MAJOR,
+min(w, h) + int_dist(x, y, 
c_x, c_y));
+   input_report_abs(input, ABS_MT_WIDTH_MINOR, 

Re: [Linuxwacom-devel] [PATCH xf86-input-wacom] conf: add Dell Canvas 27 touch

2017-11-03 Thread Benjamin Tissoires
On Fri, Nov 3, 2017 at 9:15 PM, Aaron Armstrong Skomra  wrote:
>
>
> On Fri, Nov 3, 2017 at 7:19 AM, Benjamin Tissoires
>  wrote:
>>
>> The Dell canvas 27 is an external monitor with pen and touch, but the
>> pen is provided by Wacom, and the touch by Advanced Silicon.
>> To have proper touch arbitration, we need to force xf86-input-wacom
>> to also handle the touch part.
>>
>> Signed-off-by: Benjamin Tissoires 
>> ---
>>  conf/70-wacom.conf | 9 +
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/conf/70-wacom.conf b/conf/70-wacom.conf
>> index a20e3a3..86a3f90 100644
>> --- a/conf/70-wacom.conf
>> +++ b/conf/70-wacom.conf
>> @@ -101,3 +101,12 @@ Section "InputClass"
>> Driver "wacom"
>> Option "Button2" "3"
>>  EndSection
>> +
>> +# Dell Canvas 27 (touch part is an Advanced Silicon, pen part a Wacom)
>> +Section "InputClass"
>> +Identifier "Dell Canvas 27 Touch"
>> +MatchUSBID "2575:0204"
>> +MatchDevicePath "/dev/input/event*"
>> +MatchIsTouchscreen "true"
>> +Driver "wacom"
>> +EndSection
>> --
>
>
>
> HI Benjamin,
>
> I know that the last display device that I added support for required
> changes to wcmUSB.c and
> wcmValidateDevice.c [1] for Centos 6.

Oh... I thought the xorg wacom driver was now smart enough to not
require such changes...

>
> I'm not very familiar with the x driver conf files, so it may be that this
> also accomplishes
> the same thing by another means.

I'd say it's different. Here my patch just forces the Advanced Silicon
touchscreen to be handled by xf86-input-wacom so the xorg driver can
do touch arbitration.
Your patch tweaks the tablet so that it is usable from the application
point of view.
We might need such changes also :/

> If you're just aiming for Centos 7 support,
> or if you know
> this conf file also works for Centos 6 this seems fine. Otherwise the driver
> probably needs changes
> similar to the commit below to support this device. If you'd like me to work
> on that, let me know and I'll
> see if I can find a device.

I'd be happy if you could have a look at the device itself. Note that
you need a kernel patch for it to report accurate coordinates [2].
But one solution could be to teach me what to check and I'll assess
myself if we need changes in those files too.

BTW, from my engineer point of view, I doubt we will be able to
officially support it in CentOS 6. This requires a change in the
kernel that depends on too many others (basically the whole HID
stack). But this is not a Red Hat statement, just my wish that we
should push back any request coming for this device on RHEL 6 :)

Cheers,
Benjamin

[2] https://patchwork.kernel.org/patch/10040899/

>
> Best,
> Aaron
>
> [1]
> https://sourceforge.net/p/linuxwacom/xf86-input-wacom/ci/b0a055425dfb983163b1d3c673a36aebf9536430/
>>
>> 2.13.6
>>
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> Linuxwacom-devel mailing list
>> Linuxwacom-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH input-wacom] Correct tilt range for MobileStudio/Intuos/Cintiq Pro devices

2017-11-03 Thread Jason Gerecke
The pre-3.17 kernels set up their tilt axis ranges to be 0..127 rather
than -64..+63 like with the HID kernels. We need to add a correction for
this to the wacom_mspro_pen_irq function so that userspace properly
interprets the data. Without this fix, any physical tilt angle will be
interprted as being to the upper-left (and any amount of actual up/left
tilt angle will be saturated at -64 degrees).

Fixes: cd79aac597 ("backport: MobileStudio Pro to 3.7, 2.6.38, 2.6.36, 2.6.30")
Signed-off-by: Jason Gerecke 
---
 2.6.30/wacom_wac.c | 4 
 2.6.36/wacom_wac.c | 4 
 2.6.38/wacom_wac.c | 4 
 3.7/wacom_wac.c| 4 
 4 files changed, 16 insertions(+)

diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
index ae3e1b4..1484a1a 100644
--- a/2.6.30/wacom_wac.c
+++ b/2.6.30/wacom_wac.c
@@ -1653,6 +1653,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac *wacom)
if (rotation > 899)
rotation -= 1800;
 
+   /* Fix tilt zero-point: wacom_setup_cintiq declares 0..127, not 
-63..+64 */
+   tilt_x += 64;
+   tilt_y += 64;
+
input_report_key(input, BTN_TOUCH,proximity ? tip : 
0);
input_report_key(input, BTN_STYLUS,   proximity ? sw1 : 
0);
input_report_key(input, BTN_STYLUS2,  proximity ? sw2 : 
0);
diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
index 85683d6..1d5ee35 100644
--- a/2.6.36/wacom_wac.c
+++ b/2.6.36/wacom_wac.c
@@ -1490,6 +1490,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac *wacom)
if (rotation > 899)
rotation -= 1800;
 
+   /* Fix tilt zero-point: wacom_setup_cintiq declares 0..127, not 
-63..+64 */
+   tilt_x += 64;
+   tilt_y += 64;
+
input_report_key(input, BTN_TOUCH,proximity ? tip : 
0);
input_report_key(input, BTN_STYLUS,   proximity ? sw1 : 
0);
input_report_key(input, BTN_STYLUS2,  proximity ? sw2 : 
0);
diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
index 0b8b15f..d6797a5 100644
--- a/2.6.38/wacom_wac.c
+++ b/2.6.38/wacom_wac.c
@@ -1953,6 +1953,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac *wacom)
if (rotation > 899)
rotation -= 1800;
 
+   /* Fix tilt zero-point: wacom_setup_cintiq declares 0..127, not 
-63..+64 */
+   tilt_x += 64;
+   tilt_y += 64;
+
input_report_key(input, BTN_TOUCH,proximity ? tip : 
0);
input_report_key(input, BTN_STYLUS,   proximity ? sw1 : 
0);
input_report_key(input, BTN_STYLUS2,  proximity ? sw2 : 
0);
diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
index 08d375e..cde8d22 100644
--- a/3.7/wacom_wac.c
+++ b/3.7/wacom_wac.c
@@ -1933,6 +1933,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac *wacom)
if (rotation > 899)
rotation -= 1800;
 
+   /* Fix tilt zero-point: wacom_setup_cintiq declares 0..127, not 
-63..+64 */
+   tilt_x += 64;
+   tilt_y += 64;
+
input_report_key(input, BTN_TOUCH,proximity ? tip : 
0);
input_report_key(input, BTN_STYLUS,   proximity ? sw1 : 
0);
input_report_key(input, BTN_STYLUS2,  proximity ? sw2 : 
0);
-- 
2.15.0


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH xf86-input-wacom] conf: add Dell Canvas 27 touch

2017-11-03 Thread Aaron Armstrong Skomra
On Fri, Nov 3, 2017 at 7:19 AM, Benjamin Tissoires <
benjamin.tissoi...@gmail.com> wrote:

> The Dell canvas 27 is an external monitor with pen and touch, but the
> pen is provided by Wacom, and the touch by Advanced Silicon.
> To have proper touch arbitration, we need to force xf86-input-wacom
> to also handle the touch part.
>
> Signed-off-by: Benjamin Tissoires 
> ---
>  conf/70-wacom.conf | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/conf/70-wacom.conf b/conf/70-wacom.conf
> index a20e3a3..86a3f90 100644
> --- a/conf/70-wacom.conf
> +++ b/conf/70-wacom.conf
> @@ -101,3 +101,12 @@ Section "InputClass"
> Driver "wacom"
> Option "Button2" "3"
>  EndSection
> +
> +# Dell Canvas 27 (touch part is an Advanced Silicon, pen part a Wacom)
> +Section "InputClass"
> +Identifier "Dell Canvas 27 Touch"
> +MatchUSBID "2575:0204"
> +MatchDevicePath "/dev/input/event*"
> +MatchIsTouchscreen "true"
> +Driver "wacom"
> +EndSection
> --
>


HI Benjamin,

I know that the last display device that I added support for required
changes to wcmUSB.c and
wcmValidateDevice.c [1] for Centos 6.

I'm not very familiar with the x driver conf files, so it may be that this
also accomplishes
the same thing by another means. If you're just aiming for Centos 7
support, or if you know
this conf file also works for Centos 6 this seems fine. Otherwise the
driver probably needs changes
similar to the commit below to support this device. If you'd like me to
work on that, let me know and I'll
see if I can find a device.

Best,
Aaron

[1]
https://sourceforge.net/p/linuxwacom/xf86-input-wacom/ci/b0a055425dfb983163b1d3c673a36aebf9536430/


> 2.13.6
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] New, One by Wacom, CTL-472

2017-11-03 Thread Cameron Glew
Hello everyone,

I just picked up a One by Wacom (small) tablet.
It's the new CTL-472 model.

I noticed this tablet was mentioned on the wiki *Device IDs *section:
http://linuxwacom.sourceforge.net/wiki/index.php/Device_IDs

but i couldn't see a .tablet file in the git Data folder:
https://github.com/linuxwacom/libwacom/tree/master/data

so the details of a .tablet file are below

hope this helps.
--

# Wacom
# One by Wacom (small)
# CTL-472
#
# Device IDs: http://linuxwacom.sourceforge.net/wiki/index.php/Device_IDs
# Example .tablet file:
https://github.com/linuxwacom/libwacom/blob/master/data/wacom.example
#
# Description:
# tablet is matt black, with a grid of white dots
# the back of the tablet is red
# stylus has two button and no eraser
# single power led sits above the micro usb port
# micro usb used for power and data (no bluetooth)
#
# Terminal output:
# $ lsusb | grep Wacom
# Bus 003 Device 003: ID 056a:037a Wacom Co., Ltd
#
# $ uname -r
# 4.13.0-16-generic
#

[Device]
Name=One by Wacom (small)
DeviceMatch=usb:056a:037a
Class=Bamboo
Width=6
Height=4
IntegratedIn=None

[Features]
Stylus=true
Reversible=true
Touch=false
Buttons=0
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH xf86-input-wacom] conf: add Dell Canvas 27 touch

2017-11-03 Thread Benjamin Tissoires
The Dell canvas 27 is an external monitor with pen and touch, but the
pen is provided by Wacom, and the touch by Advanced Silicon.
To have proper touch arbitration, we need to force xf86-input-wacom
to also handle the touch part.

Signed-off-by: Benjamin Tissoires 
---
 conf/70-wacom.conf | 9 +
 1 file changed, 9 insertions(+)

diff --git a/conf/70-wacom.conf b/conf/70-wacom.conf
index a20e3a3..86a3f90 100644
--- a/conf/70-wacom.conf
+++ b/conf/70-wacom.conf
@@ -101,3 +101,12 @@ Section "InputClass"
Driver "wacom"
Option "Button2" "3"
 EndSection
+
+# Dell Canvas 27 (touch part is an Advanced Silicon, pen part a Wacom)
+Section "InputClass"
+Identifier "Dell Canvas 27 Touch"
+MatchUSBID "2575:0204"
+MatchDevicePath "/dev/input/event*"
+MatchIsTouchscreen "true"
+Driver "wacom"
+EndSection
-- 
2.13.6


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH libwacom] data: Add Dell Canvas 27

2017-11-03 Thread Benjamin Tissoires
The touchscreen part is not from Wacom, so we need to
teach libwacom and libinput that both are part of the
same device group for them to do touch arbitration.

Signed-off-by: Benjamin Tissoires 
---
 data/dell-canvas-27.tablet | 40 
 1 file changed, 40 insertions(+)
 create mode 100644 data/dell-canvas-27.tablet

diff --git a/data/dell-canvas-27.tablet b/data/dell-canvas-27.tablet
new file mode 100644
index 000..eacc21f
--- /dev/null
+++ b/data/dell-canvas-27.tablet
@@ -0,0 +1,40 @@
+# Dell
+# Canvas 27
+# 
+#
+#
+#  *---*
+#  |   |
+#  |   |
+#  |   |
+#  |   |
+#  |   |
+#  |DISPLAY|
+#  |   |
+#  |   |
+#  |   |
+#  |   |
+#  |   |
+#  *---*
+#
+
+[Device]
+Name=Dell Canvas 27
+Class=Cintiq
+DeviceMatch=usb:056a:4200
+PairedID=usb:2575:0204
+Width=23
+Height=13
+# No pad buttons, so no layout
+
+# not having 0x80a (an Eraser) makes g-s-d crashes prior 3.26 (3.22 at least)
+# so add this dummy stylus that will not show up in g-c-c
+Styli=0xd;0x80a;
+IntegratedIn=Display
+
+[Features]
+Stylus=true
+Reversible=false
+Touch=true
+Ring=false
+Buttons=0
-- 
2.13.6


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel