From 83417206427bdf0fef9fa69957807194f25923c3 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Fri, 10 Nov 2017 11:50:01 -0800 Subject: 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 Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- drivers/hid/wacom_wac.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/hid/wacom_wac.c') diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index ff679ee3b358..7fa373225d8a 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2085,6 +2085,7 @@ static void wacom_wac_pen_usage_mapping(struct hid_device *hdev, wacom_map_usage(input, usage, field, EV_KEY, BTN_STYLUS2, 0); break; case HID_DG_TOOLSERIALNUMBER: + features->quirks |= WACOM_QUIRK_TOOLSERIAL; wacom_map_usage(input, usage, field, EV_MSC, MSC_SERIAL, 0); /* Adjust AES usages to match modern convention */ -- cgit v1.2.3