]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Input: alps - use more accurate coordinates for first touch in semi-mt mode
authorHans de Goede <hdegoede@redhat.com>
Wed, 20 May 2015 21:41:10 +0000 (14:41 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 20 May 2015 21:45:44 +0000 (14:45 -0700)
commit4dd265730710bd881c45d6ccf41050c3738ffccd
treea5f8310625ac2cf316a9c2fc16fc426599f77902
parent44b77f38dce59f57a679083df12509deab02cfcc
Input: alps - use more accurate coordinates for first touch in semi-mt mode

All alps semi-mt touchpads give us the following data when 2 (or more)
fingers are touching: 1 more or less accurate touch for the first finger
down, and a bitmap with columns and rows in which 1 or more fingers are
seen resulting in a crude (low res) bounding box.

So far for v3, rushmore and v4 touchpads we've been reporting the
coordinates of 2 opposite corners of the box when 2 fingers are touching.
Ignoring the much better resolution data given in the normal position
packet.

This commit actually uses this data for the first touch, figures out which
corner of the bounding box is closest to the first touch, and reports the
coordinates of the opposite corner for the second touch, resulting in
much better data for the first touch and for the single touch
pointer-emulation events.

This approach is similar to the one in alps_process_bitmap_dolphin, that
function takes the single accurate touch info, calculates the distance to
the center of the bounding box, and then puts the 2nd touch mirrored to
the center. The downside of that approach is that if both touches move
slowly in the same direction, the bounding box will stay the same for a
while (as it is low res) and the second touch will thus been seen moving
in the opposite direction until the bounding box actually changes, and
then the second touch snaps to its new position resulting in a saw tooth
pattern in the coordinates for the second touch, hence this new approach.

This commit fixes 2 finger scrolling being choppy / jumpy on these
touchpads.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/alps.c
drivers/input/mouse/alps.h