jianhai / rpms / kernel

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