linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
@ 2015-11-20 10:21 Allen Hung
  2015-11-23 13:49 ` Benjamin Tissoires
  2015-11-26 14:21 ` Jiri Kosina
  0 siblings, 2 replies; 11+ messages in thread
From: Allen Hung @ 2015-11-20 10:21 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: LKML, linux-input, Benjamin Tissoires, Allen Hung

The usage Confidence is mandary to Windows Precision Touchpad devices. The
appearance of this usage is checked in hidinput_connect but the quirk
MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
rejection for the WIN 8 touchpad devices which have implemented usage
Confidence in its input reports.

Tested on Dell XPS 13 laptop.

Signed-off-by: Allen Hung <allen_hung@dell.com>
---
 drivers/hid/hid-multitouch.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 426b2f1..13aeff9 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -448,6 +448,11 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			mt_store_field(usage, td, hi);
 			return 1;
 		case HID_DG_CONFIDENCE:
+			if (cls->name == MT_CLS_WIN_8 &&
+				field->application == HID_DG_TOUCHPAD) {
+				cls->quirks &= ~MT_QUIRK_ALWAYS_VALID;
+				cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE;
+			}
 			mt_store_field(usage, td, hi);
 			return 1;
 		case HID_DG_TIPSWITCH:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2015-11-20 10:21 [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage Allen Hung
@ 2015-11-23 13:49 ` Benjamin Tissoires
  2015-11-26 14:21 ` Jiri Kosina
  1 sibling, 0 replies; 11+ messages in thread
From: Benjamin Tissoires @ 2015-11-23 13:49 UTC (permalink / raw)
  To: Allen Hung; +Cc: Jiri Kosina, LKML, linux-input

On Fri, Nov 20, 2015 at 11:21 AM, Allen Hung <allen_hung@dell.com> wrote:
> The usage Confidence is mandary to Windows Precision Touchpad devices. The
> appearance of this usage is checked in hidinput_connect but the quirk
> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
> rejection for the WIN 8 touchpad devices which have implemented usage
> Confidence in its input reports.
>
> Tested on Dell XPS 13 laptop.
>
> Signed-off-by: Allen Hung <allen_hung@dell.com>
> ---

No side effects on non touchpads as reported by my tests.
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

>  drivers/hid/hid-multitouch.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 426b2f1..13aeff9 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -448,6 +448,11 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>                         mt_store_field(usage, td, hi);
>                         return 1;
>                 case HID_DG_CONFIDENCE:
> +                       if (cls->name == MT_CLS_WIN_8 &&
> +                               field->application == HID_DG_TOUCHPAD) {
> +                               cls->quirks &= ~MT_QUIRK_ALWAYS_VALID;
> +                               cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE;
> +                       }
>                         mt_store_field(usage, td, hi);
>                         return 1;
>                 case HID_DG_TIPSWITCH:
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2015-11-20 10:21 [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage Allen Hung
  2015-11-23 13:49 ` Benjamin Tissoires
@ 2015-11-26 14:21 ` Jiri Kosina
  2015-12-17 21:52   ` Benjamin Tissoires
  1 sibling, 1 reply; 11+ messages in thread
From: Jiri Kosina @ 2015-11-26 14:21 UTC (permalink / raw)
  To: Allen Hung; +Cc: LKML, linux-input, Benjamin Tissoires

On Fri, 20 Nov 2015, Allen Hung wrote:

> The usage Confidence is mandary to Windows Precision Touchpad devices. The
> appearance of this usage is checked in hidinput_connect but the quirk
> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
> rejection for the WIN 8 touchpad devices which have implemented usage
> Confidence in its input reports.
> 
> Tested on Dell XPS 13 laptop.
> 
> Signed-off-by: Allen Hung <allen_hung@dell.com>

Applied to for-4.5/multitouch. Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2015-11-26 14:21 ` Jiri Kosina
@ 2015-12-17 21:52   ` Benjamin Tissoires
  2015-12-21  9:45     ` Allen Hung
  0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Tissoires @ 2015-12-17 21:52 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Allen Hung, LKML, linux-input

On Thu, Nov 26, 2015 at 3:21 PM, Jiri Kosina <jikos@kernel.org> wrote:
> On Fri, 20 Nov 2015, Allen Hung wrote:
>
>> The usage Confidence is mandary to Windows Precision Touchpad devices. The
>> appearance of this usage is checked in hidinput_connect but the quirk
>> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
>> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
>> rejection for the WIN 8 touchpad devices which have implemented usage
>> Confidence in its input reports.
>>
>> Tested on Dell XPS 13 laptop.
>>
>> Signed-off-by: Allen Hung <allen_hung@dell.com>
>
> Applied to for-4.5/multitouch. Thanks,
>

Allen, looks like the Dell XPS13 2015 (or was it the 2014?) has
problems with your patch:
https://bugzilla.redhat.com/show_bug.cgi?id=1292583 (we backported
this change in the Fedora kernel 4.2.7).

Would you mind checking that this patch does not create regressions on
older series of laptops?

Thanks in advance.

Cheers,
Benjamin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2015-12-17 21:52   ` Benjamin Tissoires
@ 2015-12-21  9:45     ` Allen Hung
  2016-01-04  8:35       ` Benjamin Tissoires
  0 siblings, 1 reply; 11+ messages in thread
From: Allen Hung @ 2015-12-21  9:45 UTC (permalink / raw)
  To: Benjamin Tissoires, Jiri Kosina; +Cc: LKML, linux-input

On 12/18/2015 05:52 AM, Benjamin Tissoires wrote:
> On Thu, Nov 26, 2015 at 3:21 PM, Jiri Kosina <jikos@kernel.org> wrote:
>> On Fri, 20 Nov 2015, Allen Hung wrote:
>>
>>> The usage Confidence is mandary to Windows Precision Touchpad devices. The
>>> appearance of this usage is checked in hidinput_connect but the quirk
>>> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
>>> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
>>> rejection for the WIN 8 touchpad devices which have implemented usage
>>> Confidence in its input reports.
>>>
>>> Tested on Dell XPS 13 laptop.
>>>
>>> Signed-off-by: Allen Hung <allen_hung@dell.com>
>> Applied to for-4.5/multitouch. Thanks,
>>
> Allen, looks like the Dell XPS13 2015 (or was it the 2014?) has
> problems with your patch:
> https://bugzilla.redhat.com/show_bug.cgi?id=1292583 (we backported
> this change in the Fedora kernel 4.2.7).
>
> Would you mind checking that this patch does not create regressions on
> older series of laptops?
>
> Thanks in advance.
>
> Cheers,
> Benjamin
Hi Benjamin,

It looks like a XPS13 2014 but I can confirm this with my colleagues who are in charge of this product line. I don't mind checking this patch with more older series of laptops. I will do it and let you know the status. Should I also test the machines with Fedora 23, or just go with Ubuntu OS? The XPS machines are shipped with Ubuntu.
Btw, the issue reporter said she/he cannot reproduce the issue (posted on Dec. 18).

Regards,
Allen Hung

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2015-12-21  9:45     ` Allen Hung
@ 2016-01-04  8:35       ` Benjamin Tissoires
  2016-01-14 10:01         ` Allen Hung
  2016-06-21  9:20         ` Allen Hung
  0 siblings, 2 replies; 11+ messages in thread
From: Benjamin Tissoires @ 2016-01-04  8:35 UTC (permalink / raw)
  To: Allen Hung; +Cc: Jiri Kosina, LKML, linux-input

Hi Allen,

On Mon, Dec 21, 2015 at 10:45 AM, Allen Hung <allen_hung@dell.com> wrote:
> On 12/18/2015 05:52 AM, Benjamin Tissoires wrote:
>> On Thu, Nov 26, 2015 at 3:21 PM, Jiri Kosina <jikos@kernel.org> wrote:
>>> On Fri, 20 Nov 2015, Allen Hung wrote:
>>>
>>>> The usage Confidence is mandary to Windows Precision Touchpad devices. The
>>>> appearance of this usage is checked in hidinput_connect but the quirk
>>>> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
>>>> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
>>>> rejection for the WIN 8 touchpad devices which have implemented usage
>>>> Confidence in its input reports.
>>>>
>>>> Tested on Dell XPS 13 laptop.
>>>>
>>>> Signed-off-by: Allen Hung <allen_hung@dell.com>
>>> Applied to for-4.5/multitouch. Thanks,
>>>
>> Allen, looks like the Dell XPS13 2015 (or was it the 2014?) has
>> problems with your patch:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1292583 (we backported
>> this change in the Fedora kernel 4.2.7).
>>
>> Would you mind checking that this patch does not create regressions on
>> older series of laptops?
>>
>> Thanks in advance.
>>
>> Cheers,
>> Benjamin
> Hi Benjamin,
>
> It looks like a XPS13 2014 but I can confirm this with my colleagues who are in charge of this product line. I don't mind checking this patch with more older series of laptops. I will do it and let you know the status. Should I also test the machines with Fedora 23, or just go with Ubuntu OS? The XPS machines are shipped with Ubuntu.
> Btw, the issue reporter said she/he cannot reproduce the issue (posted on Dec. 18).
>

[Sorry for the late answer, but you guessed the holiday season did not help :)]

I think I'll just ask the reporter to confirm he can not reproduce and
then close the downstream bug.
Unless other people complains, I think we can just keep the current
state and wait :)

Cheers,
Benjamin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2016-01-04  8:35       ` Benjamin Tissoires
@ 2016-01-14 10:01         ` Allen Hung
  2016-06-21  9:20         ` Allen Hung
  1 sibling, 0 replies; 11+ messages in thread
From: Allen Hung @ 2016-01-14 10:01 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: Jiri Kosina, LKML, linux-input

Hi Benjamin,

On 01/04/2016 04:35 PM, Benjamin Tissoires wrote:
> Hi Allen,
>
> On Mon, Dec 21, 2015 at 10:45 AM, Allen Hung <allen_hung@dell.com> wrote:
>> On 12/18/2015 05:52 AM, Benjamin Tissoires wrote:
>>> On Thu, Nov 26, 2015 at 3:21 PM, Jiri Kosina <jikos@kernel.org> wrote:
>>>> On Fri, 20 Nov 2015, Allen Hung wrote:
>>>>
>>>>> The usage Confidence is mandary to Windows Precision Touchpad devices. The
>>>>> appearance of this usage is checked in hidinput_connect but the quirk
>>>>> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
>>>>> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
>>>>> rejection for the WIN 8 touchpad devices which have implemented usage
>>>>> Confidence in its input reports.
>>>>>
>>>>> Tested on Dell XPS 13 laptop.
>>>>>
>>>>> Signed-off-by: Allen Hung <allen_hung@dell.com>
>>>> Applied to for-4.5/multitouch. Thanks,
>>>>
>>> Allen, looks like the Dell XPS13 2015 (or was it the 2014?) has
>>> problems with your patch:
>>> https://bugzilla.redhat.com/show_bug.cgi?id=1292583 (we backported
>>> this change in the Fedora kernel 4.2.7).
>>>
>>> Would you mind checking that this patch does not create regressions on
>>> older series of laptops?
>>>
>>> Thanks in advance.
>>>
>>> Cheers,
>>> Benjamin
>> Hi Benjamin,
>>
>> It looks like a XPS13 2014 but I can confirm this with my colleagues who are in charge of this product line. I don't mind checking this patch with more older series of laptops. I will do it and let you know the status. Should I also test the machines with Fedora 23, or just go with Ubuntu OS? The XPS machines are shipped with Ubuntu.
>> Btw, the issue reporter said she/he cannot reproduce the issue (posted on Dec. 18).
>>
> [Sorry for the late answer, but you guessed the holiday season did not help :)]
>
> I think I'll just ask the reporter to confirm he can not reproduce and
> then close the downstream bug.
> Unless other people complains, I think we can just keep the current
> state and wait :)
>
> Cheers,
> Benjamin
I saw the issue (https://bugzilla.redhat.com/show_bug.cgi?id=1292583)
has been closed. Thank you for efforts.

Regards,
Allen Hung

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2016-01-04  8:35       ` Benjamin Tissoires
  2016-01-14 10:01         ` Allen Hung
@ 2016-06-21  9:20         ` Allen Hung
  2016-06-21 12:36           ` Benjamin Tissoires
  1 sibling, 1 reply; 11+ messages in thread
From: Allen Hung @ 2016-06-21  9:20 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: Jiri Kosina, LKML, linux-input

Hi Benjamin,

On 01/04/2016 04:35 PM, Benjamin Tissoires wrote:
> Hi Allen,
> 
> On Mon, Dec 21, 2015 at 10:45 AM, Allen Hung <allen_hung@dell.com> wrote:
>> On 12/18/2015 05:52 AM, Benjamin Tissoires wrote:
>>> On Thu, Nov 26, 2015 at 3:21 PM, Jiri Kosina <jikos@kernel.org> wrote:
>>>> On Fri, 20 Nov 2015, Allen Hung wrote:
>>>>
>>>>> The usage Confidence is mandary to Windows Precision Touchpad devices. The
>>>>> appearance of this usage is checked in hidinput_connect but the quirk
>>>>> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
>>>>> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
>>>>> rejection for the WIN 8 touchpad devices which have implemented usage
>>>>> Confidence in its input reports.
>>>>>
>>>>> Tested on Dell XPS 13 laptop.
>>>>>
>>>>> Signed-off-by: Allen Hung <allen_hung@dell.com>
>>>> Applied to for-4.5/multitouch. Thanks,
>>>>
>>> Allen, looks like the Dell XPS13 2015 (or was it the 2014?) has
>>> problems with your patch:
>>> https://bugzilla.redhat.com/show_bug.cgi?id=1292583 (we backported
>>> this change in the Fedora kernel 4.2.7).
>>>
>>> Would you mind checking that this patch does not create regressions on
>>> older series of laptops?
>>>
>>> Thanks in advance.
>>>
>>> Cheers,
>>> Benjamin
>> Hi Benjamin,
>>
>> It looks like a XPS13 2014 but I can confirm this with my colleagues who are in charge of this product line. I don't mind checking this patch with more older series of laptops. I will do it and let you know the status. Should I also test the machines with Fedora 23, or just go with Ubuntu OS? The XPS machines are shipped with Ubuntu.
>> Btw, the issue reporter said she/he cannot reproduce the issue (posted on Dec. 18).
>>
> 
> [Sorry for the late answer, but you guessed the holiday season did not help :)]
> 
> I think I'll just ask the reporter to confirm he can not reproduce and
> then close the downstream bug.
> Unless other people complains, I think we can just keep the current
> state and wait :)
> 
> Cheers,
> Benjamin
> 
My this patch 25a84db15b3f3a24d3ea7d2baf90693bcff34b0c (HID: multitouch: enable 
palm rejection if device implements confidence usage) brings side effect as
someone reported it on https://bugzilla.kernel.org/show_bug.cgi?id=112791
My fix is attached in the thread and please have a look at it and my reply in
comment #5 as the root cause.
Let me try to explain my fix here - the quirk MT_QUIRK_VALID_IS_CONFIDENCE 
is implemented in hid-multitouch and I see it was only applied to some
particular touchpad devices (see my list in the end) before my earlier patch
applies it to Windows 8 precision touchpad. I believe the quirk is working 
very well for the devices in list, and it must have some stories behind that
made the quirk designed in this way - simply dropped the reports with
[confidence = 0]. 
However, this quirk isn't working very properly for the Win8 precise touchpad.
I think when a touch is initially detected as finger then
later detected as a palm, the driver has to send the latter detections
to input/mt as calling input_mt_report_slot_state(input, MT_TOOL_FINGER, 
active=0). In order not to break the devices in list, I add a new quirk
MT_QUIRK_CONFIDENCE to do the work. Please provide your comments :)

Device list: 
MT_USB_DEVICE(USB_VENDOR_ID_3M,	USB_DEVICE_ID_3M1968)			
MT_USB_DEVICE(USB_VENDOR_ID_3M,	USB_DEVICE_ID_3M2256) 
MT_USB_DEVICE(USB_VENDOR_ID_3M,	USB_DEVICE_ID_3M3266) 
MT_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT)
MT_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) 
MT_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) 
MT_USB_DEVICE(USB_VENDOR_ID_QUANTA,	USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001) 
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM, USB_DEVICE_ID_MTP_STM)

Regards,
Allen Hung

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2016-06-21  9:20         ` Allen Hung
@ 2016-06-21 12:36           ` Benjamin Tissoires
  0 siblings, 0 replies; 11+ messages in thread
From: Benjamin Tissoires @ 2016-06-21 12:36 UTC (permalink / raw)
  To: Allen Hung; +Cc: Jiri Kosina, LKML, linux-input

Hi Allen,

On Tue, Jun 21, 2016 at 11:20 AM, Allen Hung <allen_hung@dell.com> wrote:
> Hi Benjamin,
>
> On 01/04/2016 04:35 PM, Benjamin Tissoires wrote:
>> Hi Allen,
>>
>> On Mon, Dec 21, 2015 at 10:45 AM, Allen Hung <allen_hung@dell.com> wrote:
>>> On 12/18/2015 05:52 AM, Benjamin Tissoires wrote:
>>>> On Thu, Nov 26, 2015 at 3:21 PM, Jiri Kosina <jikos@kernel.org> wrote:
>>>>> On Fri, 20 Nov 2015, Allen Hung wrote:
>>>>>
>>>>>> The usage Confidence is mandary to Windows Precision Touchpad devices. The
>>>>>> appearance of this usage is checked in hidinput_connect but the quirk
>>>>>> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
>>>>>> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
>>>>>> rejection for the WIN 8 touchpad devices which have implemented usage
>>>>>> Confidence in its input reports.
>>>>>>
>>>>>> Tested on Dell XPS 13 laptop.
>>>>>>
>>>>>> Signed-off-by: Allen Hung <allen_hung@dell.com>
>>>>> Applied to for-4.5/multitouch. Thanks,
>>>>>
>>>> Allen, looks like the Dell XPS13 2015 (or was it the 2014?) has
>>>> problems with your patch:
>>>> https://bugzilla.redhat.com/show_bug.cgi?id=1292583 (we backported
>>>> this change in the Fedora kernel 4.2.7).
>>>>
>>>> Would you mind checking that this patch does not create regressions on
>>>> older series of laptops?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Cheers,
>>>> Benjamin
>>> Hi Benjamin,
>>>
>>> It looks like a XPS13 2014 but I can confirm this with my colleagues who are in charge of this product line. I don't mind checking this patch with more older series of laptops. I will do it and let you know the status. Should I also test the machines with Fedora 23, or just go with Ubuntu OS? The XPS machines are shipped with Ubuntu.
>>> Btw, the issue reporter said she/he cannot reproduce the issue (posted on Dec. 18).
>>>
>>
>> [Sorry for the late answer, but you guessed the holiday season did not help :)]
>>
>> I think I'll just ask the reporter to confirm he can not reproduce and
>> then close the downstream bug.
>> Unless other people complains, I think we can just keep the current
>> state and wait :)
>>
>> Cheers,
>> Benjamin
>>
> My this patch 25a84db15b3f3a24d3ea7d2baf90693bcff34b0c (HID: multitouch: enable
> palm rejection if device implements confidence usage) brings side effect as
> someone reported it on https://bugzilla.kernel.org/show_bug.cgi?id=112791
> My fix is attached in the thread and please have a look at it and my reply in
> comment #5 as the root cause.
> Let me try to explain my fix here - the quirk MT_QUIRK_VALID_IS_CONFIDENCE
> is implemented in hid-multitouch and I see it was only applied to some
> particular touchpad devices (see my list in the end) before my earlier patch
> applies it to Windows 8 precision touchpad. I believe the quirk is working
> very well for the devices in list, and it must have some stories behind that
> made the quirk designed in this way - simply dropped the reports with
> [confidence = 0].
> However, this quirk isn't working very properly for the Win8 precise touchpad.
> I think when a touch is initially detected as finger then
> later detected as a palm, the driver has to send the latter detections
> to input/mt as calling input_mt_report_slot_state(input, MT_TOOL_FINGER,
> active=0). In order not to break the devices in list, I add a new quirk
> MT_QUIRK_CONFIDENCE to do the work. Please provide your comments :)
>
> Device list:
> MT_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M1968)
> MT_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M2256)
> MT_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M3266)
> MT_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT)
> MT_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO)
> MT_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART)
> MT_USB_DEVICE(USB_VENDOR_ID_QUANTA,     USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001)
> MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM, USB_DEVICE_ID_MTP_STM)
>

I was discussing with Synaptics about that last week, and I was
planning on working on it this week. Looks like you got the patch
ready before me :)
I *think* the patch is valid, and should be carried in upstream and in
stable. I'd like to have a further look at it once you submit it
however before giving my rev-by.

Regarding the device list you provided, yes those devices should
reject the touch when the confidence bit is not set. These were
Windows 7 touchscreen and the spec was not very clear and we had to
tweak the code on a per-device basis.

I think I also have a few pending patches for hid-multitouch, but your
patch might supersede those.

Cheers,
Benjamin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
  2015-11-18  9:41 Allen Hung
@ 2015-11-18 10:10 ` Benjamin Tissoires
  0 siblings, 0 replies; 11+ messages in thread
From: Benjamin Tissoires @ 2015-11-18 10:10 UTC (permalink / raw)
  To: Allen Hung; +Cc: Jiri Kosina, LKML, linux-input

On Wed, Nov 18, 2015 at 10:41 AM, Allen Hung <allen_hung@dell.com> wrote:
> The usage Confidence is mandary to Windows Precision Touchpad devices. The
> appearance of this usage is checked in hidinput_connect but the quirk
> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to the device accordingly.
> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable the
> palm rejection for the devices which implement the usage confidence in its
> input reports.
>
> Tested on Dell XPS 13 laptop.
>
> Signed-off-by: Allen Hung <allen_hung@dell.com>
> ---
>  drivers/hid/hid-multitouch.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 426b2f1..661de1d 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -448,6 +448,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>                         mt_store_field(usage, td, hi);
>                         return 1;
>                 case HID_DG_CONFIDENCE:
> +                       cls->quirks &= ~MT_QUIRK_ALWAYS_VALID;
> +                       cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE;

NACK: you are going to break a *lot* of multitouch panels with this change.

Please target the modification to only touchpads that are following
the Precision Touchpad spec. Even there, I will need to be sure that
there will be no side effect, but we will have a much thiner spectre
than blindly enabling this.

For the record, Windows 7 touchscreens used to put any meaning in the
confidence tag.

Cheers,
Benjamin

>                         mt_store_field(usage, td, hi);
>                         return 1;
>                 case HID_DG_TIPSWITCH:
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage
@ 2015-11-18  9:41 Allen Hung
  2015-11-18 10:10 ` Benjamin Tissoires
  0 siblings, 1 reply; 11+ messages in thread
From: Allen Hung @ 2015-11-18  9:41 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: LKML, linux-input, Allen Hung

The usage Confidence is mandary to Windows Precision Touchpad devices. The
appearance of this usage is checked in hidinput_connect but the quirk
MT_QUIRK_VALID_IS_CONFIDENCE is not applied to the device accordingly.
Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable the
palm rejection for the devices which implement the usage confidence in its
input reports.

Tested on Dell XPS 13 laptop.

Signed-off-by: Allen Hung <allen_hung@dell.com>
---
 drivers/hid/hid-multitouch.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 426b2f1..661de1d 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -448,6 +448,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			mt_store_field(usage, td, hi);
 			return 1;
 		case HID_DG_CONFIDENCE:
+			cls->quirks &= ~MT_QUIRK_ALWAYS_VALID;
+			cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE;
 			mt_store_field(usage, td, hi);
 			return 1;
 		case HID_DG_TIPSWITCH:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-06-21 12:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20 10:21 [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage Allen Hung
2015-11-23 13:49 ` Benjamin Tissoires
2015-11-26 14:21 ` Jiri Kosina
2015-12-17 21:52   ` Benjamin Tissoires
2015-12-21  9:45     ` Allen Hung
2016-01-04  8:35       ` Benjamin Tissoires
2016-01-14 10:01         ` Allen Hung
2016-06-21  9:20         ` Allen Hung
2016-06-21 12:36           ` Benjamin Tissoires
  -- strict thread matches above, loose matches on Subject: below --
2015-11-18  9:41 Allen Hung
2015-11-18 10:10 ` Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).