Bug 112791 - HID multitouch: pointer jumping when palm is rejected on Dell XPS 13
Summary: HID multitouch: pointer jumping when palm is rejected on Dell XPS 13
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-21 18:55 UTC by Cyril Yab
Modified: 2016-06-21 16:59 UTC (History)
4 users (show)

See Also:
Kernel Version: 4.5-rc5
Tree: Mainline
Regression: No


Attachments
Patch (2.75 KB, patch)
2016-06-16 15:54 UTC, Allen Hung
Details | Diff

Description Cyril Yab 2016-02-21 18:55:50 UTC
Since Linux 4.5, and most certainly 25a84db15b3f3a24d3ea7d2baf90693bcff34b0c (HID: multitouch: enable palm rejection if device implements confidence usage), palm detection is done by the hardware, which is good news.

However, after the palm is removed from the touchpad and a finger is put on the touchpad to move the pointer, the pointer first "jumps" from its previous location to another. This happens with both libinput and the synaptics module under Xorg, so I guess the issue is in the kernel (or touchpad firmware).

Here's an evemu-record excerpt when a palm is detected:

E: 6.801443 0003 0039 0258      # EV_ABS / ABS_MT_TRACKING_ID   258
E: 6.801443 0003 0035 0714      # EV_ABS / ABS_MT_POSITION_X    714
E: 6.801443 0003 0036 0391      # EV_ABS / ABS_MT_POSITION_Y    391
E: 6.801443 0001 014a 0001      # EV_KEY / BTN_TOUCH            1
E: 6.801443 0001 0145 0001      # EV_KEY / BTN_TOOL_FINGER      1
E: 6.801443 0003 0000 0714      # EV_ABS / ABS_X                714
E: 6.801443 0003 0001 0391      # EV_ABS / ABS_Y                391
E: 6.801443 0000 0000 0000      # ------------ SYN_REPORT (0) ---------- +5986ms
E: 6.808003 0003 0036 0392      # EV_ABS / ABS_MT_POSITION_Y    392
E: 6.808003 0003 0001 0392      # EV_ABS / ABS_Y                392
E: 6.808003 0000 0000 0000      # ------------ SYN_REPORT (0) ---------- +7ms
E: 6.814779 0003 0035 0713      # EV_ABS / ABS_MT_POSITION_X    713
E: 6.814779 0003 0000 0713      # EV_ABS / ABS_X                713
E: 6.814779 0000 0000 0000      # ------------ SYN_REPORT (0) ---------- +6ms
E: 6.828478 0003 0035 0715      # EV_ABS / ABS_MT_POSITION_X    715
E: 6.828478 0003 0000 0715      # EV_ABS / ABS_X                715
E: 6.828478 0000 0000 0000      # ------------ SYN_REPORT (0) ---------- +14ms
E: 6.835413 0003 0035 0717      # EV_ABS / ABS_MT_POSITION_X    717
E: 6.835413 0003 0036 0393      # EV_ABS / ABS_MT_POSITION_Y    393
E: 6.835413 0003 0000 0717      # EV_ABS / ABS_X                717
E: 6.835413 0003 0001 0393      # EV_ABS / ABS_Y                393
E: 6.835413 0000 0000 0000      # ------------ SYN_REPORT (0) ---------- +7ms
E: 6.842195 0003 0035 0718      # EV_ABS / ABS_MT_POSITION_X    718
E: 6.842195 0003 0036 0395      # EV_ABS / ABS_MT_POSITION_Y    395
E: 6.842195 0003 0000 0718      # EV_ABS / ABS_X                718
E: 6.842195 0003 0001 0395      # EV_ABS / ABS_Y                395
E: 6.842195 0000 0000 0000      # ------------ SYN_REPORT (0) ---------- +7ms

[palm moves on the touchpad, is filtered by the firmware]
[there's no event when the palm is lifted up]

[afterwards, I put my finger on the touchpad to make a move]

E: 14.235784 0003 0035 0450     # EV_ABS / ABS_MT_POSITION_X    450
E: 14.235784 0003 0036 0396     # EV_ABS / ABS_MT_POSITION_Y    396
E: 14.235784 0003 0000 0450     # EV_ABS / ABS_X                450
E: 14.235784 0003 0001 0396     # EV_ABS / ABS_Y                396
E: 14.235784 0000 0000 0000     # ------------ SYN_REPORT (0) ---------- +7393ms
E: 14.249453 0003 0035 0449     # EV_ABS / ABS_MT_POSITION_X    449
E: 14.249453 0003 0036 0397     # EV_ABS / ABS_MT_POSITION_Y    397
E: 14.249453 0003 0000 0449     # EV_ABS / ABS_X                449
E: 14.249453 0003 0001 0397     # EV_ABS / ABS_Y                397
E: 14.249453 0000 0000 0000     # ------------ SYN_REPORT (0) ---------- +14ms
E: 14.290212 0003 0036 0398     # EV_ABS / ABS_MT_POSITION_Y    398
E: 14.290212 0003 0001 0398     # EV_ABS / ABS_Y                398
E: 14.290212 0000 0000 0000     # ------------ SYN_REPORT (0) ---------- +41ms
E: 14.310613 0003 0036 0399     # EV_ABS / ABS_MT_POSITION_Y    399
E: 14.310613 0003 0001 0399     # EV_ABS / ABS_Y                399
E: 14.310613 0000 0000 0000     # ------------ SYN_REPORT (0) ---------- +20ms
E: 14.330343 0003 0039 -001     # EV_ABS / ABS_MT_TRACKING_ID   -1
E: 14.330343 0001 014a 0000     # EV_KEY / BTN_TOUCH            0
E: 14.330343 0001 0145 0000     # EV_KEY / BTN_TOOL_FINGER      0
E: 14.330343 0000 0000 0000     # ------------ SYN_REPORT (0) ---------- +20ms
Comment 1 Cyril Yab 2016-02-21 19:00:03 UTC
A couple of precisions: the laptop model is 9350 (late 2015), and that issue doesn't happen under Windows 10.
Comment 2 Mario 2016-04-08 11:03:52 UTC
Same laptop and same problem using Arch Linux and kernel 4.6rc2. The problem exists since early rc releases of 4.5.
Comment 3 Allen Hung 2016-06-16 15:54:10 UTC
Created attachment 220311 [details]
Patch

Hi Cyril,
I am the author of 25a84db15b3f3a24d3ea7d2baf90693bcff34b0c. The attach is my patch to fix the bug you reported here. I have verified it on Dell XPS13. Could you help to verify the patch? If the result is positive, I will submit it to upstream.

Allen
Comment 4 Cyril B. 2016-06-16 16:27:14 UTC
Hi Allen,

Actually I cannot reproduce the issue on a vanilla kernel 4.6, so I guess something must have changed since 4.5? Do you still want me to test your patch on a 4.6?
Comment 5 Allen Hung 2016-06-21 03:27:16 UTC
Hi Cyril, 

I can still reproduce the issue on Ubuntu 16.04 with vanilla kernel 4.6.0 on XPS13. The file "drivers/hid/hid-multitouch.c" is where my patch applied on and it has no relevant changes between 4.5 and 4.6. Maybe the change has been made in some other where. 

The root cause is that the touch reports with (confidence=0) are directly dropped by hid-multitouch driver, without sending to upward layers. If there is a palm touch, says touch A, that is initially detected as a finger (confidence=1) and soon after is detected as a palm (conf=0) then the system is not aware of the latter change. The system still thinks there was a finger touch but then no reports were received. Once you make a new finger touch, says touch B, on a different position than where the palm has previously touched on, the system will treat touch A and touch B as in a continuous touch then the jumping occurs.

As I saw the problem is still there in 4.6 I will try to get this fix upstream.
Comment 6 Mario 2016-06-21 16:59:43 UTC
Dear Allen,
as you can read from comment #2 in this report, I had these kind of problems with the XPS 13 (9350) touchpad since early rc releases of kernel 4.5. They are still present in kernel 4.6.2.
As workaround I was used to switch on psmouse modules blacklisting i2c_hid one. This implied a different (less sensible) feedback but at least it worked.
I'm using your patch on a 4.6.2 kernel built on my Arch Linux (Gnome desktop) with i2c_hid module. It is greatly working for me since at least 2 hours. I guess it fixes the regression introduced in kernel 4.5.

Thank you for restoring the love for my touchpad! ;)

Please, push this patch upstream ASAP.

Note You need to log in before you can comment on or make changes to this bug.