]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - pending-4.14/hid-wacom-sync-intuosp2_bt-touch-state-after-each-frame-if-necessary.patch
move existing queues out of the way for the moment...
[thirdparty/kernel/stable-queue.git] / pending-4.14 / hid-wacom-sync-intuosp2_bt-touch-state-after-each-frame-if-necessary.patch
CommitLineData
4ab92ec7
GKH
1From 69dbdfffef20c715df9f381b2cee4e9e0a4efd93 Mon Sep 17 00:00:00 2001
2From: Jason Gerecke <jason.gerecke@wacom.com>
3Date: Tue, 7 May 2019 11:53:22 -0700
4Subject: HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary
5
6From: Jason Gerecke <jason.gerecke@wacom.com>
7
8commit 69dbdfffef20c715df9f381b2cee4e9e0a4efd93 upstream.
9
10The Bluetooth interface of the 2nd-gen Intuos Pro batches together four
11independent "frames" of finger data into a single report. Each frame
12is essentially equivalent to a single USB report, with the up-to-10
13fingers worth of information being spread across two frames. At the
14moment the driver only calls `input_sync` after processing all four
15frames have been processed, which can result in the driver sending
16multiple updates for a single slot within the same SYN_REPORT. This
17can confuse userspace, so modify the driver to sync more often if
18necessary (i.e., after reporting the state of all fingers).
19
20Fixes: 4922cd26f03c ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface")
21Cc: <stable@vger.kernel.org> # 4.11+
22Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
23Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26---
27 drivers/hid/wacom_wac.c | 10 ++++++++--
28 1 file changed, 8 insertions(+), 2 deletions(-)
29
30--- a/drivers/hid/wacom_wac.c
31+++ b/drivers/hid/wacom_wac.c
32@@ -1328,11 +1328,17 @@ static void wacom_intuos_pro2_bt_touch(s
33 if (wacom->num_contacts_left <= 0) {
34 wacom->num_contacts_left = 0;
35 wacom->shared->touch_down = wacom_wac_finger_count_touches(wacom);
36+ input_sync(touch_input);
37 }
38 }
39
40- input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7));
41- input_sync(touch_input);
42+ if (wacom->num_contacts_left == 0) {
43+ // Be careful that we don't accidentally call input_sync with
44+ // only a partial set of fingers of processed
45+ input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7));
46+ input_sync(touch_input);
47+ }
48+
49 }
50
51 static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom)