libinput pressure detection: clarification for drivers

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 6 03:08:48 UTC 2017


On Fri, Mar 03, 2017 at 06:41:31PM -0800, Life is hard, and then you die wrote:
> 
> I was testing out the new pressure-based touch detection in libinput
> (on a new MBP where the sensitivy is such that it's been possible to
> move the mouse without actually touching the touchpad, so this new
> feature is very welcome) and realized that it appears the drivers must
> send actual ABS_MT_PRESSURE or ABS_PRESSURE events. 

fwiw, "must" is a bit strongly worded here. Yes, libinput currently only
looks at either of those two but there's no reason we can't look at anything
else. Main problem is that of time and device availability, almost all
touchpad devices I see have pressure, few have touch major/minor.

And the ones that do send relatively random values for those, despite them
being supposedly well-defined. That's at least true for the touchscreens
I've seen, not sure on touchpads.

> From reading the
> kernel documentation at
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/input/multi-touch-protocol.txt
> I was under the impression that these events were only needed for
> devices that didn't provide ABS_MT_TOUCH_MAJOR/ABS_MT_WIDTH_MAJOR .
> 
> So my question is basically: am I misreading the above doc, and should
> drivers then always report pressure events even if they already report
> touch and width events?

Do what the kernel doc says and let's add major/minor to libinput, that's
the long-term plan forward.

> Btw., I noticed that the bcm5974 driver only sends only ABS_PRESSURE
> (not ABS_MT_PRESSURE) even though it has the ABS_MT_SLOT capability
> set, so AFAICT the pressure-detection won't work for that device (and
> the emulation in test/litest-device-bcm5974.c seems misleading since
> that is sending ABS_MT_PRESSURE events).

oh, oops. Can you file a bug for that please so I can get that fixed?
thanks.

Cheers,
   Peter


More information about the wayland-devel mailing list