diff options
author | Jason Gerecke <killertofu@gmail.com> | 2017-11-10 20:50:01 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-11-21 13:04:35 +0100 |
commit | 83417206427bdf0fef9fa69957807194f25923c3 (patch) | |
tree | e7d1350d7acd2ddcbb116c203a5b5ad8552f033b /drivers/hid/wacom_wac.h | |
parent | HID: wacom: Properly handle AES serial number and tool type (diff) | |
download | linux-83417206427bdf0fef9fa69957807194f25923c3.tar.xz linux-83417206427bdf0fef9fa69957807194f25923c3.zip |
HID: wacom: Queue events with missing type/serial data for later processing
Userspace expects to receive tool type and serial number information
for the active pen in the very first kernel report, if such data is
supported by the hardware. While this expectation is not an issue for
EMR devices, AES sensors will often send several packets worth of in-
range data before relaying type/serial data to the kernel. Sending this
data "late" can result in proximity-tracking issues by xf86-input-wacom,
or an inability to distinguish different pens by input-wacom.
Options for dealing with this situation include ignoring reports from
the tablet until we get the necessary data, or using the information
from the last-seen pen instead of the (eventual) real data. Neither
option is particularly attractive: the former results in truncated
strokes and the latter causes issues with switching between pens.
This commit instead opts to queue up events with missing information
until we receive a report which contains it. At that point, we can
update the driver's state variables (id[0] and serial[0]) and replay
the queued events.
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_wac.h')
-rw-r--r-- | drivers/hid/wacom_wac.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 6fe6d60f9ab5..15d9c14fbdf7 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -11,6 +11,7 @@ #include <linux/types.h> #include <linux/hid.h> +#include <linux/kfifo.h> /* maximum packet length for USB/BT devices */ #define WACOM_PKGLEN_MAX 361 @@ -88,6 +89,7 @@ #define WACOM_QUIRK_SENSE 0x0002 #define WACOM_QUIRK_AESPEN 0x0004 #define WACOM_QUIRK_BATTERY 0x0008 +#define WACOM_QUIRK_TOOLSERIAL 0x0010 /* device types */ #define WACOM_DEVICETYPE_NONE 0x0000 @@ -339,6 +341,7 @@ struct wacom_wac { struct input_dev *pen_input; struct input_dev *touch_input; struct input_dev *pad_input; + struct kfifo_rec_ptr_2 pen_fifo; int pid; int num_contacts_left; u8 bt_features; |