diff --git a/SOURCES/0001-Correct-two-comments.patch b/SOURCES/0001-Correct-two-comments.patch new file mode 100644 index 0000000..6f29f0c --- /dev/null +++ b/SOURCES/0001-Correct-two-comments.patch @@ -0,0 +1,39 @@ +From ce73d3ff5f3d2be67bd1213e21163db938943ac5 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 24 Oct 2018 10:10:46 +1000 +Subject: [PATCH 1/4] Correct two comments + +Signed-off-by: Peter Hutterer +Reviewed-by: Ping Cheng +(cherry picked from commit 6e2728780056614e4b2f37abde4f60f072edc95a) +--- + src/wcmUSB.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/wcmUSB.c b/src/wcmUSB.c +index 8ded958..8a07368 100644 +--- a/src/wcmUSB.c ++++ b/src/wcmUSB.c +@@ -980,9 +980,7 @@ static void usbParseEvent(InputInfoPtr pInfo, + + DBG(10, common, "\n"); + +- /* store events until we receive the MSC_SERIAL containing +- * the serial number or a SYN_REPORT. +- */ ++ /* store events until we receive a SYN_REPORT */ + + /* space left? bail if not. */ + if (private->wcmEventCnt >= ARRAY_SIZE(private->wcmEvents)) +@@ -1036,7 +1034,7 @@ static void usbParseSynEvent(InputInfoPtr pInfo, + } + else + { +- /* not an SYN_REPORT and not an SYN_REPORT, bail out */ ++ /* not a MSC_SERIAL and not a SYN_REPORT, bail out */ + return; + } + +-- +2.19.2 + diff --git a/SOURCES/0001-Ratelimit-the-device-type-mismatch-warning.patch b/SOURCES/0001-Ratelimit-the-device-type-mismatch-warning.patch new file mode 100644 index 0000000..5481a67 --- /dev/null +++ b/SOURCES/0001-Ratelimit-the-device-type-mismatch-warning.patch @@ -0,0 +1,48 @@ +From 83ffb252fae8faeace89ed066c0ec37376824ff2 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Thu, 30 May 2019 09:08:52 +1000 +Subject: [PATCH] Ratelimit the device type mismatch warning + +This message still happens when the software buttons are pressed and +immediately after plug. Since the actual events just fall through and don't +cause any state changes, let's ratelimit the message so it doesn't fill up the +logs. + +https://bugzilla.redhat.com/show_bug.cgi?id=1642197 + +Signed-off-by: Peter Hutterer +--- + src/wcmUSB.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/src/wcmUSB.c b/src/wcmUSB.c +index 2f0e1d7..481646d 100644 +--- a/src/wcmUSB.c ++++ b/src/wcmUSB.c +@@ -1788,10 +1788,19 @@ static void usbDispatchEvents(InputInfoPtr pInfo) + ds = &common->wcmChannel[channel].work; + dslast = common->wcmChannel[channel].valid.state; + +- if (ds->device_type && ds->device_type != private->wcmDeviceType) +- LogMessageVerbSigSafe(X_ERROR, 0, +- "usbDispatchEvents: Device Type mismatch - %d -> %d. This is a BUG.\n", +- ds->device_type, private->wcmDeviceType); ++ if (ds->device_type && ds->device_type != private->wcmDeviceType) { ++ static int warnings = 0; ++ ++ if (warnings < 5) { ++ warnings++; ++ LogMessageVerbSigSafe(X_ERROR, 0, ++ "usbDispatchEvents: Device Type mismatch - %d -> %d. This is a BUG.\n", ++ ds->device_type, private->wcmDeviceType); ++ if (warnings == 5) ++ LogMessageVerbSigSafe(X_ERROR, 0, ++ "usbDispatchEvents: above bug warning is suppressed now\n"); ++ } ++ } + /* no device type? */ + if (!ds->device_type && private->wcmDeviceType) { + ds->device_type = private->wcmDeviceType; +-- +2.21.0 + diff --git a/SOURCES/0002-Reformat-a-debugging-message.patch b/SOURCES/0002-Reformat-a-debugging-message.patch new file mode 100644 index 0000000..09935cb --- /dev/null +++ b/SOURCES/0002-Reformat-a-debugging-message.patch @@ -0,0 +1,33 @@ +From a1221ddfa36a3295f115b6f44e0f8a7069d97bc2 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 24 Oct 2018 10:21:40 +1000 +Subject: [PATCH 2/4] Reformat a debugging message + +No functional changes but makes grepping for it a lot easier + +Signed-off-by: Peter Hutterer +Reviewed-by: Ping Cheng +(cherry picked from commit cafb587a4eb89d906317dbe347198b523e494c76) +--- + src/wcmUSB.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/wcmUSB.c b/src/wcmUSB.c +index 8a07368..be9be6e 100644 +--- a/src/wcmUSB.c ++++ b/src/wcmUSB.c +@@ -1041,9 +1041,8 @@ static void usbParseSynEvent(InputInfoPtr pInfo, + /* ignore events without information */ + if ((private->wcmEventCnt < 2) && private->wcmLastToolSerial) + { +- DBG(3, common, "%s: dropping empty event" +- " for serial %d\n", pInfo->name, +- private->wcmLastToolSerial); ++ DBG(3, common, "%s: dropping empty event for serial %d\n", ++ pInfo->name, private->wcmLastToolSerial); + goto skipEvent; + } + +-- +2.19.2 + diff --git a/SOURCES/0003-Split-EV_MSC-handling-out-of-the-EV_SYN-handling.patch b/SOURCES/0003-Split-EV_MSC-handling-out-of-the-EV_SYN-handling.patch new file mode 100644 index 0000000..d3e5d2e --- /dev/null +++ b/SOURCES/0003-Split-EV_MSC-handling-out-of-the-EV_SYN-handling.patch @@ -0,0 +1,113 @@ +From 7523a530494484e8b92e0c8604fb39a51b4887f8 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 24 Oct 2018 10:15:58 +1000 +Subject: [PATCH 3/4] Split EV_MSC handling out of the EV_SYN handling + +The only thing these two had in common was the reset of the event count on +failure. Might as well split them up to make the code more readable. + +Signed-off-by: Peter Hutterer +Reviewed-by: Ping Cheng +(cherry picked from commit 8a6f201fde45b6aef9785bdfbfd0d908ff1c4071) +--- + src/wcmUSB.c | 68 +++++++++++++++++++++++++++++++--------------------- + 1 file changed, 41 insertions(+), 27 deletions(-) + +diff --git a/src/wcmUSB.c b/src/wcmUSB.c +index be9be6e..cf89ff8 100644 +--- a/src/wcmUSB.c ++++ b/src/wcmUSB.c +@@ -59,6 +59,8 @@ static void usbParseEvent(InputInfoPtr pInfo, + const struct input_event* event); + static void usbParseSynEvent(InputInfoPtr pInfo, + const struct input_event *event); ++static void usbParseMscEvent(InputInfoPtr pInfo, ++ const struct input_event *event); + static void usbDispatchEvents(InputInfoPtr pInfo); + static int usbChooseChannel(WacomCommonPtr common, int device_type, unsigned int serial); + +@@ -994,8 +996,44 @@ static void usbParseEvent(InputInfoPtr pInfo, + /* save it for later */ + private->wcmEvents[private->wcmEventCnt++] = *event; + +- if (event->type == EV_MSC || event->type == EV_SYN) +- usbParseSynEvent(pInfo, event); ++ switch (event->type) ++ { ++ case EV_MSC: ++ usbParseMscEvent(pInfo, event); ++ break; ++ case EV_SYN: ++ usbParseSynEvent(pInfo, event); ++ break; ++ default: ++ break; ++ } ++} ++ ++static void usbParseMscEvent(InputInfoPtr pInfo, ++ const struct input_event *event) ++{ ++ WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; ++ WacomCommonPtr common = priv->common; ++ wcmUSBData* private = common->private; ++ ++ if (event->code != MSC_SERIAL) ++ return; ++ ++ if (event->value != 0) ++ { ++ /* save the serial number so we can look up the channel number later */ ++ private->wcmLastToolSerial = event->value; ++ } ++ else ++ { ++ /* we don't report serial numbers for some tools but we never report ++ * a serial number with a value of 0 - if that happens drop the ++ * whole frame */ ++ LogMessageVerbSigSafe(X_ERROR, 0, ++ "%s: usbParse: Ignoring event from invalid serial 0\n", ++ pInfo->name); ++ private->wcmEventCnt = 0; ++ } + } + + /** +@@ -1011,33 +1049,9 @@ static void usbParseSynEvent(InputInfoPtr pInfo, + WacomCommonPtr common = priv->common; + wcmUSBData* private = common->private; + +- if ((event->type == EV_MSC) && (event->code == MSC_SERIAL)) +- { +- /* we don't report serial numbers for some tools +- * but we never report a serial number with a value of 0 */ +- if (event->value == 0) +- { +- LogMessageVerbSigSafe(X_ERROR, 0, +- "%s: usbParse: Ignoring event from invalid serial 0\n", +- pInfo->name); +- goto skipEvent; +- } +- +- /* save the serial number so we can look up the channel number later */ +- private->wcmLastToolSerial = event->value; +- ++ if (event->code != SYN_REPORT) + return; + +- } else if ((event->type == EV_SYN) && (event->code == SYN_REPORT)) +- { +- /* end of record. fall through to dispatch */ +- } +- else +- { +- /* not a MSC_SERIAL and not a SYN_REPORT, bail out */ +- return; +- } +- + /* ignore events without information */ + if ((private->wcmEventCnt < 2) && private->wcmLastToolSerial) + { +-- +2.19.2 + diff --git a/SOURCES/0004-Remember-the-event-types-we-receive-and-skip-events-.patch b/SOURCES/0004-Remember-the-event-types-we-receive-and-skip-events-.patch new file mode 100644 index 0000000..4745034 --- /dev/null +++ b/SOURCES/0004-Remember-the-event-types-we-receive-and-skip-events-.patch @@ -0,0 +1,118 @@ +From 13b35027202496be168b3c345cd6fc65055f9604 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 24 Oct 2018 10:35:17 +1000 +Subject: [PATCH 4/4] Remember the event types we receive and skip events with + no data + +On RHEL7.x kernels we get event frames with merely MSC_SERIAL -1 for some +devices on proximity in. This is caused by the accelerometer data that is +otherwise suppressed by those kernels. + +E: 123.456 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +E: 123.456 0004 0000 -001 # EV_MSC / MSC_SERIAL -1 + +For a MSC_SERIAL -1 we default to the PAD_ID (0x10), despite the events +happening on the Pen device node. This triggers an error message during EV_SYN +processing: + + (EE) usbDispatchEvents: Device Type mismatch - 16 -> 0. This is a BUG. + +Once we receive the BTN_TOOL_PEN when the actual pen comes into proximity, the +error message goes away because our tool type matches with what we expect. + +Fix this issue by remembering which event types we received in the current +frame. If all we got was EV_MSC, skip the event dispatch - we don't have any +data to process anyway. + +Signed-off-by: Peter Hutterer +Reviewed-by: Ping Cheng +(cherry picked from commit 84400df38f0f9abe664de26a8d3747b10f3a05e5) +--- + src/wcmUSB.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/src/wcmUSB.c b/src/wcmUSB.c +index cf89ff8..2bb6b78 100644 +--- a/src/wcmUSB.c ++++ b/src/wcmUSB.c +@@ -38,6 +38,7 @@ typedef struct { + int wcmMTChannel; + int wcmEventCnt; + struct input_event wcmEvents[MAX_USB_EVENTS]; ++ uint32_t wcmEventFlags; /* event types received in this frame */ + int nbuttons; /* total number of buttons */ + int npadkeys; /* number of pad keys in the above array */ + int padkey_code[WCM_MAX_BUTTONS];/* hardware codes for buttons */ +@@ -973,6 +974,13 @@ static int usbChooseChannel(WacomCommonPtr common, int device_type, unsigned int + return channel; + } + ++static inline void ++usbResetEventCounter(wcmUSBData *private) ++{ ++ private->wcmEventCnt = 0; ++ private->wcmEventFlags = 0; ++} ++ + static void usbParseEvent(InputInfoPtr pInfo, + const struct input_event* event) + { +@@ -989,12 +997,13 @@ static void usbParseEvent(InputInfoPtr pInfo, + { + LogMessageVerbSigSafe(X_ERROR, 0, "%s: usbParse: Exceeded event queue (%d) \n", + pInfo->name, private->wcmEventCnt); +- private->wcmEventCnt = 0; ++ usbResetEventCounter(private); + return; + } + + /* save it for later */ + private->wcmEvents[private->wcmEventCnt++] = *event; ++ private->wcmEventFlags |= 1 << event->type; + + switch (event->type) + { +@@ -1032,7 +1041,7 @@ static void usbParseMscEvent(InputInfoPtr pInfo, + LogMessageVerbSigSafe(X_ERROR, 0, + "%s: usbParse: Ignoring event from invalid serial 0\n", + pInfo->name); +- private->wcmEventCnt = 0; ++ usbResetEventCounter(private); + } + } + +@@ -1048,6 +1057,7 @@ static void usbParseSynEvent(InputInfoPtr pInfo, + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; + WacomCommonPtr common = priv->common; + wcmUSBData* private = common->private; ++ const uint32_t significant_event_types = ~(1 << EV_SYN | 1 << EV_MSC); + + if (event->code != SYN_REPORT) + return; +@@ -1060,9 +1070,11 @@ static void usbParseSynEvent(InputInfoPtr pInfo, + goto skipEvent; + } + +- /* ignore sync windows that contain no data */ +- if (private->wcmEventCnt == 1 && +- private->wcmEvents->type == EV_SYN) { ++ ++ /* If all we get in an event frame is EV_SYN/EV_MSC, we don't have ++ * real data to process. */ ++ if ((private->wcmEventFlags & significant_event_types) == 0) ++ { + DBG(6, common, "no real events received\n"); + goto skipEvent; + } +@@ -1071,7 +1083,7 @@ static void usbParseSynEvent(InputInfoPtr pInfo, + usbDispatchEvents(pInfo); + + skipEvent: +- private->wcmEventCnt = 0; ++ usbResetEventCounter(private); + } + + static int usbFilterEvent(WacomCommonPtr common, struct input_event *event) +-- +2.19.2 + diff --git a/SPECS/xorg-x11-drv-wacom.spec b/SPECS/xorg-x11-drv-wacom.spec index 70768eb..2453152 100644 --- a/SPECS/xorg-x11-drv-wacom.spec +++ b/SPECS/xorg-x11-drv-wacom.spec @@ -9,7 +9,7 @@ Summary: Xorg X11 wacom input driver Name: xorg-x11-drv-wacom Version: 0.36.1 -Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} URL: http://www.x.org License: GPLv2+ Group: User Interface/X Hardware Support @@ -22,6 +22,13 @@ Source2: commitid Source0: https://github.com/linuxwacom/xf86-input-wacom/releases/download/xf86-input-wacom-%{version}/xf86-input-wacom-%{version}.tar.bz2 %endif +# Bug 1642197 - Cintiq 27QHD triggers error messages on proximity in +Patch01: 0001-Correct-two-comments.patch +Patch02: 0002-Reformat-a-debugging-message.patch +Patch03: 0003-Split-EV_MSC-handling-out-of-the-EV_SYN-handling.patch +Patch04: 0004-Remember-the-event-types-we-receive-and-skip-events-.patch +Patch05: 0001-Ratelimit-the-device-type-mismatch-warning.patch + ExcludeArch: s390 s390x BuildRequires: xorg-x11-server-devel >= 1.10.99.902 @@ -41,6 +48,11 @@ X.Org X11 wacom input driver for Wacom tablets. %prep %setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} +%patch01 -p1 +%patch02 -p1 +%patch03 -p1 +%patch04 -p1 +%patch05 -p1 %build autoreconf --force -v --install || exit 1 @@ -102,6 +114,15 @@ X.Org X11 wacom input driver development files. %{_bindir}/isdv4-serial-debugger %changelog +* Thu May 30 2019 Peter Hutterer 0.36.1-3 +- Ratelimit the bug message warnings (#1642197) + +* Thu Jan 10 2019 Peter Hutterer 0.36.1-2 +- Fix Cintiq 27QHD error message on proximity in (#1642197) + +* Wed May 30 2018 Adam Jackson - 0.36.1-1.1 +- Rebuild for xserver 1.20 + * Tue May 15 2018 Peter Hutterer 0.36.1-1 - wacom 0.36.1 (#1564630)