]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
Input - synaptics: pin 3 touches when the firmware reports 3 fingers
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Thu, 16 Apr 2015 17:01:46 +0000 (13:01 -0400)
committerJulien Grall <julien.grall@citrix.com>
Fri, 18 Sep 2015 15:29:31 +0000 (16:29 +0100)
Synaptics PS/2 touchpad can send only 2 touches in a report. They can
detect 4 or 5 and this information is valuable.

In commit 63c4fda (Input: synaptics - allocate 3 slots to keep stability
in image sensors), we allocate 3 slots, but we still continue to report
the 2 available fingers. That means that the client sees 2 used slots while
there is a total of 3 fingers advertised by BTN_TOOL_TRIPLETAP.

For old kernels this is not a problem because max_slots was 2 and libinput/
xorg-synaptics knew how to deal with that. Now that max_slot is 3, the
clients ignore BTN_TOOL_TRIPLETAP and count the actual used slots (so 2).
It then gets confused when receiving the BTN_TOOL_TRIPLETAP and DOUBLETAP
information, and goes wild.

We can pin the 3 slots until we get a total number of fingers below 2.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1212230
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/input/mouse/synaptics.c

index 6025eb430c0a5010c908961ccf8897943fd3c945..73aa87f5d5907e428bac0fa28d1a7bbcd40f633e 100644 (file)
@@ -940,6 +940,14 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
                input_report_abs(dev, ABS_MT_PRESSURE, hw[i]->z);
        }
 
+       /* keep (slot count <= num_fingers) by pinning all slots */
+       if (num_fingers >= 3) {
+               for (i = 0; i < 3; i++) {
+                       input_mt_slot(dev, i);
+                       input_mt_report_slot_state(dev, MT_TOOL_FINGER, true);
+               }
+       }
+
        input_mt_drop_unused(dev);
 
        /* Don't use active slot count to generate BTN_TOOL events. */