Bug 100243 - Handle MT_TOOL_PALM
Summary: Handle MT_TOOL_PALM
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
Depends on: 100309
  Show dependency treegraph
Reported: 2017-03-17 00:54 UTC by Peter Hutterer
Modified: 2017-04-26 03:08 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

large contact on pod (207.35 KB, text/plain)
2017-03-22 00:32 UTC, Andrew Duggan

Description Peter Hutterer 2017-03-17 00:54:08 UTC
see subject, the RMI4 driver now uses that tool type
Comment 1 Andrew Duggan 2017-03-22 00:32:22 UTC
Created attachment 130366 [details]
large contact on pod

Here is an example of a large contact which the firmware would report as a palm. I just used the side of my palm.
Comment 2 Peter Hutterer 2017-03-22 05:33:17 UTC
I'm wondering if just fixing bug #94236 is enough rather than handling MT_TOOL_TYPE on top of the other palm detection we need anyway. But there are a few obstacles to that, specically: how is ABS_MT_TOUCH_MAJOR/MINOR used in the driver? Or rather, how am I supposed to use it?

According to the doc it *should* be in surface coordinates but the highest value in this recording is 25. Given 12 u/mm that would be a 2mm contact so you either have very very tiny hands or something is wrong here :)

In addition the axis max is 15, but the tool type palm is set at a major/minor of 13/9, so the max value seems to be a bit random.
Comment 3 Andrew Duggan 2017-03-31 21:21:05 UTC
As you may have seen ABS_MT_TOUCH_MAJOR/MINOR are set based on values that the firmware reports W/X and W/Y. The W is a representation of width, but it doesn't actually correspond with any sort of units.

Older devices which use RMI4 function 11 report both W values in a single byte. Each value being 4 bits. That's why the max is set to 15. Newer devices which use F12 now have use a byte for each W value. Newer devices should have a larger max.

The device I used to create the log used F12 which is why the actual values exceed the max.
Comment 4 Peter Hutterer 2017-04-03 06:13:57 UTC
ok, I implemented MT_TOOL_PALM support for now. Can I get you to try this branch please?


as for the major/minor handling, if there's some reliable way to converting from the firmware values to a useful value, that'd be good. I'd rather not use something that relies on DMI-specifics again.
Comment 5 Peter Hutterer 2017-04-18 02:31:55 UTC
Andrew, any chance you can test the branch I linked to?
Comment 6 Andrew Duggan 2017-04-19 04:07:37 UTC
Sorry about the delay. I gave it a quick test and it seems to suppress the pointer when I rub my palm on the touchpad. Performance feels similar to that of hid-multitouch which suppressed palms in the kernel. I'll keep testing and update if I find anything.
Comment 7 Peter Hutterer 2017-04-21 00:12:58 UTC
thanks for the testing. series is on the list now, I'll merge this after a while and we can fix  bugs from then if you notice some.
Comment 8 Peter Hutterer 2017-04-26 03:08:06 UTC
commit 9495713b05d244b0293cbf4fc5e6a7094ee50e27
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Apr 3 13:58:42 2017 +1000

    touchpad: add MT_TOOL-based palm detection

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.