chengshan / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
e336be
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
e336be
Date: Thu, 16 Apr 2015 13:01:46 -0400
e336be
Subject: [PATCH] Input - synaptics: pin 3 touches when the firmware reports 3
e336be
 fingers
e336be
e336be
Synaptics PS/2 touchpad can send only 2 touches in a report. They can
e336be
detect 4 or 5 and this information is valuable.
e336be
e336be
In commit 63c4fda (Input: synaptics - allocate 3 slots to keep stability
e336be
in image sensors), we allocate 3 slots, but we still continue to report
e336be
the 2 available fingers. That means that the client sees 2 used slots while
e336be
there is a total of 3 fingers advertised by BTN_TOOL_TRIPLETAP.
e336be
e336be
For old kernels this is not a problem because max_slots was 2 and libinput/
e336be
xorg-synaptics knew how to deal with that. Now that max_slot is 3, the
e336be
clients ignore BTN_TOOL_TRIPLETAP and count the actual used slots (so 2).
e336be
It then gets confused when receiving the BTN_TOOL_TRIPLETAP and DOUBLETAP
e336be
information, and goes wild.
e336be
e336be
We can pin the 3 slots until we get a total number of fingers below 2.
e336be
e336be
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1212230
e336be
e336be
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
e336be
---
e336be
 drivers/input/mouse/synaptics.c | 8 ++++++++
e336be
 1 file changed, 8 insertions(+)
e336be
e336be
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
e336be
index 3a32caf06bf1..58102970f94f 100644
e336be
--- a/drivers/input/mouse/synaptics.c
e336be
+++ b/drivers/input/mouse/synaptics.c
e336be
@@ -940,6 +940,14 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
e336be
 		input_report_abs(dev, ABS_MT_PRESSURE, hw[i]->z);
e336be
 	}
e336be
 
e336be
+	/* keep (slot count <= num_fingers) by pinning all slots */
e336be
+	if (num_fingers >= 3) {
e336be
+		for (i = 0; i < 3; i++) {
e336be
+			input_mt_slot(dev, i);
e336be
+			input_mt_report_slot_state(dev, MT_TOOL_FINGER, true);
e336be
+		}
e336be
+	}
e336be
+
e336be
 	input_mt_drop_unused(dev);
e336be
 
e336be
 	/* Don't use active slot count to generate BTN_TOOL events. */