diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2019-05-07 14:53:22 -0400 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-05-17 12:21:56 -0400 |
commit | 69dbdfffef20c715df9f381b2cee4e9e0a4efd93 (patch) | |
tree | 8fef17c9b4f17ce8b461ae9d4dcbe783901099ae /drivers/hid | |
parent | 6441fc781c344df61402be1fde582c4491fa35fa (diff) |
HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary
The Bluetooth interface of the 2nd-gen Intuos Pro batches together four
independent "frames" of finger data into a single report. Each frame
is essentially equivalent to a single USB report, with the up-to-10
fingers worth of information being spread across two frames. At the
moment the driver only calls `input_sync` after processing all four
frames have been processed, which can result in the driver sending
multiple updates for a single slot within the same SYN_REPORT. This
can confuse userspace, so modify the driver to sync more often if
necessary (i.e., after reporting the state of all fingers).
Fixes: 4922cd26f03c ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface")
Cc: <stable@vger.kernel.org> # 4.11+
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/wacom_wac.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index e848445236d8..09b8e4aac82f 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c | |||
@@ -1371,11 +1371,17 @@ static void wacom_intuos_pro2_bt_touch(struct wacom_wac *wacom) | |||
1371 | if (wacom->num_contacts_left <= 0) { | 1371 | if (wacom->num_contacts_left <= 0) { |
1372 | wacom->num_contacts_left = 0; | 1372 | wacom->num_contacts_left = 0; |
1373 | wacom->shared->touch_down = wacom_wac_finger_count_touches(wacom); | 1373 | wacom->shared->touch_down = wacom_wac_finger_count_touches(wacom); |
1374 | input_sync(touch_input); | ||
1374 | } | 1375 | } |
1375 | } | 1376 | } |
1376 | 1377 | ||
1377 | input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7)); | 1378 | if (wacom->num_contacts_left == 0) { |
1378 | input_sync(touch_input); | 1379 | // Be careful that we don't accidentally call input_sync with |
1380 | // only a partial set of fingers of processed | ||
1381 | input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7)); | ||
1382 | input_sync(touch_input); | ||
1383 | } | ||
1384 | |||
1379 | } | 1385 | } |
1380 | 1386 | ||
1381 | static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom) | 1387 | static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom) |