From 6ed46bac1f350280bb4a2638e1342f7c3b19a0b6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 18 Feb 2016 11:49:04 +1000 Subject: [PATCH 01/11] libinput 1.1.8 --- .gitignore | 1 + libinput.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d3a5b6f..7779ed2 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ /libinput-1.1.5.tar.xz /libinput-1.1.6.tar.xz /libinput-1.1.7.tar.xz +/libinput-1.1.8.tar.xz diff --git a/libinput.spec b/libinput.spec index 8f15c3a..8c8eb41 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.1.7 +Version: 1.1.8 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -97,6 +97,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Thu Feb 18 2016 Peter Hutterer 1.1.8-1 +- libinput 1.1.8 + * Wed Feb 10 2016 Peter Hutterer 1.1.7-1 - libinput 1.1.7 diff --git a/sources b/sources index 360d317..07d7a38 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a501715a6135ac1f772bb5f3e3183481 libinput-1.1.7.tar.xz +3dda3e6dd7d0e865896dfe67f4fa0346 libinput-1.1.8.tar.xz From 7a73ca3b06ea859ee3596040d8deed62b57a06b3 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 2 Mar 2016 07:22:16 +1000 Subject: [PATCH 02/11] libinput 1.2.1 --- .gitignore | 1 + libinput.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7779ed2..9b86930 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /libinput-1.1.6.tar.xz /libinput-1.1.7.tar.xz /libinput-1.1.8.tar.xz +/libinput-1.2.1.tar.xz diff --git a/libinput.spec b/libinput.spec index 8c8eb41..a3869df 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.1.8 +Version: 1.2.1 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -97,6 +97,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Wed Mar 02 2016 Peter Hutterer 1.2.1-1 +- libinput 1.2.1 + * Thu Feb 18 2016 Peter Hutterer 1.1.8-1 - libinput 1.1.8 diff --git a/sources b/sources index 07d7a38..5e3e22f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3dda3e6dd7d0e865896dfe67f4fa0346 libinput-1.1.8.tar.xz +2b36d32362111c3e99f19c83bc535332 libinput-1.2.1.tar.xz From 3285a7d47d2eb50c1349d4b763f358e192e50c62 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 2 Mar 2016 07:55:30 +1000 Subject: [PATCH 03/11] Add libwacom-devel to BuildRequires --- libinput.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libinput.spec b/libinput.spec index a3869df..84cc2a3 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.2.1 -Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -25,7 +25,7 @@ BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel BuildRequires: libudev-devel -BuildRequires: mtdev-devel +BuildRequires: mtdev-devel libwacom-devel BuildRequires: pkgconfig(udev) %description @@ -97,6 +97,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Wed Mar 02 2016 Peter Hutterer 1.2.1-2 +- Add libwacom-devel to BuildRequires + * Wed Mar 02 2016 Peter Hutterer 1.2.1-1 - libinput 1.2.1 From 57a02c4fdaf850af0d4cbf65dbf94c369879a322 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 7 Mar 2016 10:19:22 +1000 Subject: [PATCH 04/11] Fix segfault on mislabeled tablets (#1314955) --- ...et-reject-mislabelled-tablet-devices.patch | 66 +++++++++++++++++++ libinput.spec | 8 ++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 0001-tablet-reject-mislabelled-tablet-devices.patch diff --git a/0001-tablet-reject-mislabelled-tablet-devices.patch b/0001-tablet-reject-mislabelled-tablet-devices.patch new file mode 100644 index 0000000..f8e7071 --- /dev/null +++ b/0001-tablet-reject-mislabelled-tablet-devices.patch @@ -0,0 +1,66 @@ +From 821ac1f9d5ea1267ea125c67e7652c8cc14e9cb3 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 7 Mar 2016 10:12:13 +1000 +Subject: [PATCH libinput] tablet: reject mislabelled tablet devices + +The HUION 580 has a "consumer control" event node that has an ABS_VOLUME, keys +and a REL_HWHEEL. It has the same VID/PID as the pen tablet and libwacom +labels it as ID_INPUT_TABLET. This causes a crash later when we try to init +pointer acceleration for a device that doesn't have axes. + +https://bugzilla.redhat.com/show_bug.cgi?id=1314955 + +Signed-off-by: Peter Hutterer +--- + src/evdev-tablet.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c +index 0f6fa2c..9fc38aa 100644 +--- a/src/evdev-tablet.c ++++ b/src/evdev-tablet.c +@@ -1613,6 +1613,31 @@ tablet_init_left_handed(struct evdev_device *device) + } + + static int ++tablet_reject_device(struct evdev_device *device) ++{ ++ struct libevdev *evdev = device->evdev; ++ int rc = -1; ++ ++ if (!libevdev_has_event_code(evdev, EV_ABS, ABS_X) || ++ !libevdev_has_event_code(evdev, EV_ABS, ABS_Y)) ++ goto out; ++ ++ if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN)) ++ goto out; ++ ++ rc = 0; ++ ++out: ++ if (rc) { ++ log_bug_libinput(device->base.seat->libinput, ++ "Device '%s' does not meet tablet criteria. " ++ "Ignoring this device.\n", ++ device->devname, device->devname); ++ } ++ return rc; ++} ++ ++static int + tablet_init(struct tablet_dispatch *tablet, + struct evdev_device *device) + { +@@ -1625,6 +1650,9 @@ tablet_init(struct tablet_dispatch *tablet, + tablet->current_tool_type = LIBINPUT_TOOL_NONE; + list_init(&tablet->tool_list); + ++ if (tablet_reject_device(device)) ++ return -1; ++ + tablet_init_calibration(tablet, device); + tablet_init_proximity_threshold(tablet, device); + rc = tablet_init_accel(tablet, device); +-- +2.5.0 + diff --git a/libinput.spec b/libinput.spec index 84cc2a3..4236be8 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.2.1 -Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -21,6 +21,9 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version} # Not upstream, keep until kernel 4.2 or 4.1.x with dbf3c37086 Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1314955 +Patch02: 0001-tablet-reject-mislabelled-tablet-devices.patch + BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel @@ -97,6 +100,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Mon Mar 07 2016 Peter Hutterer 1.2.1-3 +- Fix segfault on mislabeled tablets (#1314955) + * Wed Mar 02 2016 Peter Hutterer 1.2.1-2 - Add libwacom-devel to BuildRequires From f922107f77830c74075a60bf070725d0088cd4b8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 11 Mar 2016 10:34:01 +1000 Subject: [PATCH 05/11] Fix jerky pointer motion on the Lenovo T450/T460/X1 3rd hardware --- ...rk-for-the-T450-and-T460-generation-.patch | 170 ++++++++++++++++++ libinput.spec | 8 +- 2 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch diff --git a/0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch b/0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch new file mode 100644 index 0000000..2bbb711 --- /dev/null +++ b/0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch @@ -0,0 +1,170 @@ +From a608d9dc2c70c7915fc94466ed27c1684f65409e Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 7 Mar 2016 16:05:25 +1000 +Subject: [PATCH libinput] touchpad: add quirk for the T450 and T460 generation + hardware + +The touchpad's sensors are too far apart (or the firmware interferes), causing +in a jerky movement visible especially on slow motion. We get a bunch of +normal motion events, then only ABS_MT_PRESSURE updates without x/y updates. +After about one mm of movement x/y updates resume, with the first event +covering the distance between the last motion event. That event is usually +accelerated and thus causes a large jump. Subsequent events are sufficiently +fine-grained again. + +This patch counts the number of non-motion events. Once we hit 10 in a row, we +mark the first motion update as non-dirty, effectively discarding the motion +and thus stopping the pointer jumps. + +https://bugs.freedesktop.org/show_bug.cgi?id=94379 + +Signed-off-by: Peter Hutterer +Tested-by: Benjamin Tissoires +--- + src/evdev-mt-touchpad.c | 32 ++++++++++++++++++++++++++++---- + src/evdev-mt-touchpad.h | 12 ++++++++++++ + src/evdev.c | 1 + + src/evdev.h | 1 + + udev/90-libinput-model-quirks.hwdb | 7 +++++++ + 5 files changed, 49 insertions(+), 4 deletions(-) + +diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c +index 00d6539..d0a8e27 100644 +--- a/src/evdev-mt-touchpad.c ++++ b/src/evdev-mt-touchpad.c +@@ -337,7 +337,7 @@ tp_process_absolute(struct tp_dispatch *tp, + case ABS_MT_PRESSURE: + t->pressure = e->value; + t->dirty = true; +- tp->queued |= TOUCHPAD_EVENT_MOTION; ++ tp->queued |= TOUCHPAD_EVENT_OTHERAXIS; + break; + } + } +@@ -880,8 +880,10 @@ tp_position_fake_touches(struct tp_dispatch *tp) + } + + static inline bool +-tp_need_motion_history_reset(struct tp_dispatch *tp) ++tp_need_motion_history_reset(struct tp_dispatch *tp, uint64_t time) + { ++ bool rc = false; ++ + /* semi-mt finger postions may "jump" when nfingers changes */ + if (tp->semi_mt && tp->nfingers_down != tp->old_nfingers_down) + return true; +@@ -894,7 +896,29 @@ tp_need_motion_history_reset(struct tp_dispatch *tp) + tp->old_nfingers_down > tp->num_slots)) + return true; + +- return false; ++ /* Quirk: if we had multiple events without x/y axis ++ information, the next x/y event is going to be a jump. So we ++ reset that touch to non-dirty effectively swallowing that event ++ and restarting with the next event again. ++ */ ++ if (tp->device->model_flags & EVDEV_MODEL_LENOVO_T450_TOUCHPAD) { ++ if (tp->queued & TOUCHPAD_EVENT_MOTION) { ++ if (tp->quirks.nonmotion_event_count > 10) { ++ struct tp_touch *t; ++ ++ tp_for_each_touch(tp, t) ++ t->dirty = false; ++ rc = true; ++ } ++ tp->quirks.nonmotion_event_count = 0; ++ } ++ ++ if ((tp->queued & (TOUCHPAD_EVENT_OTHERAXIS|TOUCHPAD_EVENT_MOTION)) == ++ TOUCHPAD_EVENT_OTHERAXIS) ++ tp->quirks.nonmotion_event_count++; ++ } ++ ++ return rc; + } + + static void +@@ -909,7 +933,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) + tp_unhover_touches(tp, time); + tp_position_fake_touches(tp); + +- want_motion_reset = tp_need_motion_history_reset(tp); ++ want_motion_reset = tp_need_motion_history_reset(tp, time); + + for (i = 0; i < tp->ntouches; i++) { + t = tp_get_touch(tp, i); +diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h +index eae327b..1f05a03 100644 +--- a/src/evdev-mt-touchpad.h ++++ b/src/evdev-mt-touchpad.h +@@ -41,6 +41,7 @@ enum touchpad_event { + TOUCHPAD_EVENT_MOTION = (1 << 0), + TOUCHPAD_EVENT_BUTTON_PRESS = (1 << 1), + TOUCHPAD_EVENT_BUTTON_RELEASE = (1 << 2), ++ TOUCHPAD_EVENT_OTHERAXIS = (1 << 3), + }; + + enum touchpad_model { +@@ -353,6 +354,17 @@ struct tp_dispatch { + int upper_thumb_line; + int lower_thumb_line; + } thumb; ++ ++ struct { ++ /* A quirk used on the T450 series Synaptics hardware. ++ * Slowly moving the finger causes multiple events with only ++ * ABS_MT_PRESSURE but no x/y information. When the x/y ++ * event comes, it will be a jump of ~20 units. We use the ++ * below to count non-motion events to discard that first ++ * event with the jump. ++ */ ++ unsigned int nonmotion_event_count; ++ } quirks; + }; + + #define tp_for_each_touch(_tp, _t) \ +diff --git a/src/evdev.c b/src/evdev.c +index 51768fe..a5c965d 100644 +--- a/src/evdev.c ++++ b/src/evdev.c +@@ -1680,6 +1680,7 @@ evdev_read_model_flags(struct evdev_device *device) + { "LIBINPUT_MODEL_CYBORG_RAT", EVDEV_MODEL_CYBORG_RAT }, + { "LIBINPUT_MODEL_CYAPA", EVDEV_MODEL_CYAPA }, + { "LIBINPUT_MODEL_ALPS_RUSHMORE", EVDEV_MODEL_ALPS_RUSHMORE }, ++ { "LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD", EVDEV_MODEL_LENOVO_T450_TOUCHPAD }, + { NULL, EVDEV_MODEL_DEFAULT }, + }; + const struct model_map *m = model_map; +diff --git a/src/evdev.h b/src/evdev.h +index 482712b..4a5d807 100644 +--- a/src/evdev.h ++++ b/src/evdev.h +@@ -113,6 +113,7 @@ enum evdev_device_model { + EVDEV_MODEL_CYBORG_RAT = (1 << 14), + EVDEV_MODEL_CYAPA = (1 << 15), + EVDEV_MODEL_ALPS_RUSHMORE = (1 << 16), ++ EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), + }; + + struct mt_slot { +diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb +index eb2859e..d5978f7 100644 +--- a/udev/90-libinput-model-quirks.hwdb ++++ b/udev/90-libinput-model-quirks.hwdb +@@ -100,6 +100,13 @@ libinput:name:Cypress APA Trackpad (cyapa):dmi:* + libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPadX230* + LIBINPUT_MODEL_LENOVO_X230=1 + ++# Lenovo T450/T460 and all other Lenovos of the *50 and *60 generation, ++# including the X1 Carbon 3rd gen ++libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPad??50*: ++libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPad??60*: ++libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPadX1Carbon3rd:* ++ LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD=1 ++ + ########################################## + # Synaptics + ########################################## +-- +2.5.0 + diff --git a/libinput.spec b/libinput.spec index 4236be8..a6e4942 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.2.1 -Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -24,6 +24,9 @@ Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1314955 Patch02: 0001-tablet-reject-mislabelled-tablet-devices.patch +# https://bugs.freedesktop.org/show_bug.cgi?id=94379 +Patch03: 0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch + BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel @@ -100,6 +103,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Fri Mar 11 2016 Peter Hutterer 1.2.1-4 +- Fix jerky pointer motion on the Lenovo T450/T460/X1 3rd hardware + * Mon Mar 07 2016 Peter Hutterer 1.2.1-3 - Fix segfault on mislabeled tablets (#1314955) From 363e9d4c1c7c25664777862561e63fa41d1cdfdb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 15 Mar 2016 10:35:58 +1000 Subject: [PATCH 06/11] libinput 1.2.2 --- .gitignore | 1 + ...et-reject-mislabelled-tablet-devices.patch | 66 ------- ...rk-for-the-T450-and-T460-generation-.patch | 170 ------------------ libinput.spec | 13 +- sources | 2 +- 5 files changed, 7 insertions(+), 245 deletions(-) delete mode 100644 0001-tablet-reject-mislabelled-tablet-devices.patch delete mode 100644 0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch diff --git a/.gitignore b/.gitignore index 9b86930..4e3a92e 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ /libinput-1.1.7.tar.xz /libinput-1.1.8.tar.xz /libinput-1.2.1.tar.xz +/libinput-1.2.2.tar.xz diff --git a/0001-tablet-reject-mislabelled-tablet-devices.patch b/0001-tablet-reject-mislabelled-tablet-devices.patch deleted file mode 100644 index f8e7071..0000000 --- a/0001-tablet-reject-mislabelled-tablet-devices.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 821ac1f9d5ea1267ea125c67e7652c8cc14e9cb3 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 7 Mar 2016 10:12:13 +1000 -Subject: [PATCH libinput] tablet: reject mislabelled tablet devices - -The HUION 580 has a "consumer control" event node that has an ABS_VOLUME, keys -and a REL_HWHEEL. It has the same VID/PID as the pen tablet and libwacom -labels it as ID_INPUT_TABLET. This causes a crash later when we try to init -pointer acceleration for a device that doesn't have axes. - -https://bugzilla.redhat.com/show_bug.cgi?id=1314955 - -Signed-off-by: Peter Hutterer ---- - src/evdev-tablet.c | 28 ++++++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - -diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c -index 0f6fa2c..9fc38aa 100644 ---- a/src/evdev-tablet.c -+++ b/src/evdev-tablet.c -@@ -1613,6 +1613,31 @@ tablet_init_left_handed(struct evdev_device *device) - } - - static int -+tablet_reject_device(struct evdev_device *device) -+{ -+ struct libevdev *evdev = device->evdev; -+ int rc = -1; -+ -+ if (!libevdev_has_event_code(evdev, EV_ABS, ABS_X) || -+ !libevdev_has_event_code(evdev, EV_ABS, ABS_Y)) -+ goto out; -+ -+ if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN)) -+ goto out; -+ -+ rc = 0; -+ -+out: -+ if (rc) { -+ log_bug_libinput(device->base.seat->libinput, -+ "Device '%s' does not meet tablet criteria. " -+ "Ignoring this device.\n", -+ device->devname, device->devname); -+ } -+ return rc; -+} -+ -+static int - tablet_init(struct tablet_dispatch *tablet, - struct evdev_device *device) - { -@@ -1625,6 +1650,9 @@ tablet_init(struct tablet_dispatch *tablet, - tablet->current_tool_type = LIBINPUT_TOOL_NONE; - list_init(&tablet->tool_list); - -+ if (tablet_reject_device(device)) -+ return -1; -+ - tablet_init_calibration(tablet, device); - tablet_init_proximity_threshold(tablet, device); - rc = tablet_init_accel(tablet, device); --- -2.5.0 - diff --git a/0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch b/0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch deleted file mode 100644 index 2bbb711..0000000 --- a/0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch +++ /dev/null @@ -1,170 +0,0 @@ -From a608d9dc2c70c7915fc94466ed27c1684f65409e Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 7 Mar 2016 16:05:25 +1000 -Subject: [PATCH libinput] touchpad: add quirk for the T450 and T460 generation - hardware - -The touchpad's sensors are too far apart (or the firmware interferes), causing -in a jerky movement visible especially on slow motion. We get a bunch of -normal motion events, then only ABS_MT_PRESSURE updates without x/y updates. -After about one mm of movement x/y updates resume, with the first event -covering the distance between the last motion event. That event is usually -accelerated and thus causes a large jump. Subsequent events are sufficiently -fine-grained again. - -This patch counts the number of non-motion events. Once we hit 10 in a row, we -mark the first motion update as non-dirty, effectively discarding the motion -and thus stopping the pointer jumps. - -https://bugs.freedesktop.org/show_bug.cgi?id=94379 - -Signed-off-by: Peter Hutterer -Tested-by: Benjamin Tissoires ---- - src/evdev-mt-touchpad.c | 32 ++++++++++++++++++++++++++++---- - src/evdev-mt-touchpad.h | 12 ++++++++++++ - src/evdev.c | 1 + - src/evdev.h | 1 + - udev/90-libinput-model-quirks.hwdb | 7 +++++++ - 5 files changed, 49 insertions(+), 4 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 00d6539..d0a8e27 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -337,7 +337,7 @@ tp_process_absolute(struct tp_dispatch *tp, - case ABS_MT_PRESSURE: - t->pressure = e->value; - t->dirty = true; -- tp->queued |= TOUCHPAD_EVENT_MOTION; -+ tp->queued |= TOUCHPAD_EVENT_OTHERAXIS; - break; - } - } -@@ -880,8 +880,10 @@ tp_position_fake_touches(struct tp_dispatch *tp) - } - - static inline bool --tp_need_motion_history_reset(struct tp_dispatch *tp) -+tp_need_motion_history_reset(struct tp_dispatch *tp, uint64_t time) - { -+ bool rc = false; -+ - /* semi-mt finger postions may "jump" when nfingers changes */ - if (tp->semi_mt && tp->nfingers_down != tp->old_nfingers_down) - return true; -@@ -894,7 +896,29 @@ tp_need_motion_history_reset(struct tp_dispatch *tp) - tp->old_nfingers_down > tp->num_slots)) - return true; - -- return false; -+ /* Quirk: if we had multiple events without x/y axis -+ information, the next x/y event is going to be a jump. So we -+ reset that touch to non-dirty effectively swallowing that event -+ and restarting with the next event again. -+ */ -+ if (tp->device->model_flags & EVDEV_MODEL_LENOVO_T450_TOUCHPAD) { -+ if (tp->queued & TOUCHPAD_EVENT_MOTION) { -+ if (tp->quirks.nonmotion_event_count > 10) { -+ struct tp_touch *t; -+ -+ tp_for_each_touch(tp, t) -+ t->dirty = false; -+ rc = true; -+ } -+ tp->quirks.nonmotion_event_count = 0; -+ } -+ -+ if ((tp->queued & (TOUCHPAD_EVENT_OTHERAXIS|TOUCHPAD_EVENT_MOTION)) == -+ TOUCHPAD_EVENT_OTHERAXIS) -+ tp->quirks.nonmotion_event_count++; -+ } -+ -+ return rc; - } - - static void -@@ -909,7 +933,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) - tp_unhover_touches(tp, time); - tp_position_fake_touches(tp); - -- want_motion_reset = tp_need_motion_history_reset(tp); -+ want_motion_reset = tp_need_motion_history_reset(tp, time); - - for (i = 0; i < tp->ntouches; i++) { - t = tp_get_touch(tp, i); -diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h -index eae327b..1f05a03 100644 ---- a/src/evdev-mt-touchpad.h -+++ b/src/evdev-mt-touchpad.h -@@ -41,6 +41,7 @@ enum touchpad_event { - TOUCHPAD_EVENT_MOTION = (1 << 0), - TOUCHPAD_EVENT_BUTTON_PRESS = (1 << 1), - TOUCHPAD_EVENT_BUTTON_RELEASE = (1 << 2), -+ TOUCHPAD_EVENT_OTHERAXIS = (1 << 3), - }; - - enum touchpad_model { -@@ -353,6 +354,17 @@ struct tp_dispatch { - int upper_thumb_line; - int lower_thumb_line; - } thumb; -+ -+ struct { -+ /* A quirk used on the T450 series Synaptics hardware. -+ * Slowly moving the finger causes multiple events with only -+ * ABS_MT_PRESSURE but no x/y information. When the x/y -+ * event comes, it will be a jump of ~20 units. We use the -+ * below to count non-motion events to discard that first -+ * event with the jump. -+ */ -+ unsigned int nonmotion_event_count; -+ } quirks; - }; - - #define tp_for_each_touch(_tp, _t) \ -diff --git a/src/evdev.c b/src/evdev.c -index 51768fe..a5c965d 100644 ---- a/src/evdev.c -+++ b/src/evdev.c -@@ -1680,6 +1680,7 @@ evdev_read_model_flags(struct evdev_device *device) - { "LIBINPUT_MODEL_CYBORG_RAT", EVDEV_MODEL_CYBORG_RAT }, - { "LIBINPUT_MODEL_CYAPA", EVDEV_MODEL_CYAPA }, - { "LIBINPUT_MODEL_ALPS_RUSHMORE", EVDEV_MODEL_ALPS_RUSHMORE }, -+ { "LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD", EVDEV_MODEL_LENOVO_T450_TOUCHPAD }, - { NULL, EVDEV_MODEL_DEFAULT }, - }; - const struct model_map *m = model_map; -diff --git a/src/evdev.h b/src/evdev.h -index 482712b..4a5d807 100644 ---- a/src/evdev.h -+++ b/src/evdev.h -@@ -113,6 +113,7 @@ enum evdev_device_model { - EVDEV_MODEL_CYBORG_RAT = (1 << 14), - EVDEV_MODEL_CYAPA = (1 << 15), - EVDEV_MODEL_ALPS_RUSHMORE = (1 << 16), -+ EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), - }; - - struct mt_slot { -diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb -index eb2859e..d5978f7 100644 ---- a/udev/90-libinput-model-quirks.hwdb -+++ b/udev/90-libinput-model-quirks.hwdb -@@ -100,6 +100,13 @@ libinput:name:Cypress APA Trackpad (cyapa):dmi:* - libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPadX230* - LIBINPUT_MODEL_LENOVO_X230=1 - -+# Lenovo T450/T460 and all other Lenovos of the *50 and *60 generation, -+# including the X1 Carbon 3rd gen -+libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPad??50*: -+libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPad??60*: -+libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPadX1Carbon3rd:* -+ LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD=1 -+ - ########################################## - # Synaptics - ########################################## --- -2.5.0 - diff --git a/libinput.spec b/libinput.spec index a6e4942..7345804 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,8 +4,8 @@ %global gitversion 58abea394 Name: libinput -Version: 1.2.1 -Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Version: 1.2.2 +Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -21,12 +21,6 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version} # Not upstream, keep until kernel 4.2 or 4.1.x with dbf3c37086 Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1314955 -Patch02: 0001-tablet-reject-mislabelled-tablet-devices.patch - -# https://bugs.freedesktop.org/show_bug.cgi?id=94379 -Patch03: 0001-touchpad-add-quirk-for-the-T450-and-T460-generation-.patch - BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel @@ -103,6 +97,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Tue Mar 15 2016 Peter Hutterer 1.2.2-1 +- libinput 1.2.2 + * Fri Mar 11 2016 Peter Hutterer 1.2.1-4 - Fix jerky pointer motion on the Lenovo T450/T460/X1 3rd hardware diff --git a/sources b/sources index 5e3e22f..c27791a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2b36d32362111c3e99f19c83bc535332 libinput-1.2.1.tar.xz +4e8d1cc7aa941c91c61b1824e35160c4 libinput-1.2.2.tar.xz From 3ca14d6080071d2b693c010cb374ad9e6bfed595 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 12 Apr 2016 08:06:23 +1000 Subject: [PATCH 07/11] libinput 1.2.3 --- .gitignore | 1 + libinput.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4e3a92e..321926a 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ /libinput-1.1.8.tar.xz /libinput-1.2.1.tar.xz /libinput-1.2.2.tar.xz +/libinput-1.2.3.tar.xz diff --git a/libinput.spec b/libinput.spec index 7345804..aff1e11 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.2.2 +Version: 1.2.3 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -97,6 +97,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Tue Apr 12 2016 Peter Hutterer 1.2.3-1 +- libinput 1.2.3 + * Tue Mar 15 2016 Peter Hutterer 1.2.2-1 - libinput 1.2.2 diff --git a/sources b/sources index c27791a..9d3e8bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4e8d1cc7aa941c91c61b1824e35160c4 libinput-1.2.2.tar.xz +9f3d603942fefac8860e0fc828a3df99 libinput-1.2.3.tar.xz From 941dd395d865aff420d15c05ea71e05f9f630c31 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 19 Apr 2016 10:24:00 +1000 Subject: [PATCH 08/11] libinput 1.2.4 --- .gitignore | 1 + libinput.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 321926a..8cfc779 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ /libinput-1.2.1.tar.xz /libinput-1.2.2.tar.xz /libinput-1.2.3.tar.xz +/libinput-1.2.4.tar.xz diff --git a/libinput.spec b/libinput.spec index aff1e11..1f4d89e 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.2.3 +Version: 1.2.4 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -97,6 +97,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Tue Apr 19 2016 Peter Hutterer 1.2.4-1 +- libinput 1.2.4 + * Tue Apr 12 2016 Peter Hutterer 1.2.3-1 - libinput 1.2.3 diff --git a/sources b/sources index 9d3e8bc..379965a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9f3d603942fefac8860e0fc828a3df99 libinput-1.2.3.tar.xz +1cbaa34f04a336f2703906d564e0a37a libinput-1.2.4.tar.xz From 149c403c761f10691b451179c7b69f69bfc8d2da Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 12 May 2016 11:51:28 +1000 Subject: [PATCH 09/11] discard large cursor jumps (#1335307) --- ...-the-html-docs-available-as-a-define.patch | 66 ++++++ ...and-warn-about-kernel-tracking-point.patch | 210 ++++++++++++++++++ libinput.spec | 7 +- 3 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 0001-Make-a-link-to-the-html-docs-available-as-a-define.patch create mode 100644 0001-touchpad-detect-and-warn-about-kernel-tracking-point.patch diff --git a/0001-Make-a-link-to-the-html-docs-available-as-a-define.patch b/0001-Make-a-link-to-the-html-docs-available-as-a-define.patch new file mode 100644 index 0000000..7b809e1 --- /dev/null +++ b/0001-Make-a-link-to-the-html-docs-available-as-a-define.patch @@ -0,0 +1,66 @@ +From e968549f2c4f1d51a921ed4997fc9151d0d91ccb Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 27 Apr 2016 11:32:02 +1000 +Subject: [PATCH libinput] Make a link to the html docs available as a #define + +The "latest" documentation link is the location for the master branch, +released versions have their own directory on the server. + +The micro-versions of 90 and above are used for snapshots and release +candidates, so whenever we have a micro version of >= 90 we still want to link +to the "latest" documentation. In all other cases, we link to the current +release. + +Signed-off-by: Peter Hutterer +Reviewed-by: Benjamin Tissoires +Reviewed-by: Hans de Goede +(cherry picked from commit 4fdaa1b2a96d5d9e7d121fc7082737cc581e8020) +--- + configure.ac | 4 ++++ + src/libinput-private.h | 8 ++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 602a860..77270fa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -17,6 +17,10 @@ AC_SUBST([LIBINPUT_VERSION_MINOR], [libinput_minor_version]) + AC_SUBST([LIBINPUT_VERSION_MICRO], [libinput_micro_version]) + AC_SUBST([LIBINPUT_VERSION], [libinput_version]) + ++AC_DEFINE([LIBINPUT_VERSION_MAJOR], [libinput_major_version], "libinput major version number") ++AC_DEFINE([LIBINPUT_VERSION_MINOR], [libinput_minor_version], "libinput minor version number") ++AC_DEFINE([LIBINPUT_VERSION_MICRO], [libinput_micro_version], "libinput micro version number") ++ + AC_CONFIG_HEADERS([config.h]) + AC_CONFIG_MACRO_DIR([m4]) + +diff --git a/src/libinput-private.h b/src/libinput-private.h +index 8d2492a..f89ca2e 100644 +--- a/src/libinput-private.h ++++ b/src/libinput-private.h +@@ -25,6 +25,8 @@ + #ifndef LIBINPUT_PRIVATE_H + #define LIBINPUT_PRIVATE_H + ++#include "config.h" ++ + #include + #include + +@@ -33,6 +35,12 @@ + #include "libinput.h" + #include "libinput-util.h" + ++#if LIBINPUT_VERSION_MICRO >= 90 ++#define HTTP_DOC_LINK "https://wayland.freedesktop.org/libinput/doc/latest/" ++#else ++#define HTTP_DOC_LINK "https://wayland.freedesktop.org/libinput/doc/" VERSION "/" ++#endif ++ + struct libinput_source; + + /* A coordinate pair in device coordinates */ +-- +2.7.4 + diff --git a/0001-touchpad-detect-and-warn-about-kernel-tracking-point.patch b/0001-touchpad-detect-and-warn-about-kernel-tracking-point.patch new file mode 100644 index 0000000..9d486fb --- /dev/null +++ b/0001-touchpad-detect-and-warn-about-kernel-tracking-point.patch @@ -0,0 +1,210 @@ +From 1814c8586b62000caab91c5af40f7c5a0a80c384 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 16 Sep 2014 15:13:00 +1000 +Subject: [PATCH libinput] touchpad: detect and warn about kernel tracking + pointer jumps + +If a touch moves by more than 20mm within a single frame, reset the motion +history, effectively discarding the movement. This is a relatively common bug +and almost always needs a kernel fix, so add an explanatory page to the docs. + +Signed-off-by: Peter Hutterer +Reviewed-by: Benjamin Tissoires +Reviewed-by: Hans de Goede +(cherry picked from commit 6a22eed4efa2a18664d62c6d8131c05258f869ab) +--- + doc/Makefile.am | 1 + + doc/page-hierarchy.dox | 1 + + doc/touchpad-jumping-cursors.dox | 54 ++++++++++++++++++++++++++++++++++++++++ + src/evdev-mt-touchpad.c | 27 ++++++++++++++++++++ + test/touchpad.c | 39 +++++++++++++++++++++++++++++ + 5 files changed, 122 insertions(+) + create mode 100644 doc/touchpad-jumping-cursors.dox + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index 7a7c6cf..f56ed6a 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -27,6 +27,7 @@ header_files = \ + $(srcdir)/tapping.dox \ + $(srcdir)/test-suite.dox \ + $(srcdir)/tools.dox \ ++ $(srcdir)/touchpad-jumping-cursors.dox \ + $(srcdir)/touchpads.dox + + diagram_files = \ +diff --git a/doc/page-hierarchy.dox b/doc/page-hierarchy.dox +index 1351a5e..e47e98e 100644 +--- a/doc/page-hierarchy.dox ++++ b/doc/page-hierarchy.dox +@@ -7,6 +7,7 @@ + - @subpage gestures + - @subpage palm_detection + - @subpage t440_support ++- @subpage touchpad_jumping_cursor + + @page touchscreens Touchscreens + +diff --git a/doc/touchpad-jumping-cursors.dox b/doc/touchpad-jumping-cursors.dox +new file mode 100644 +index 0000000..e581eb1 +--- /dev/null ++++ b/doc/touchpad-jumping-cursors.dox +@@ -0,0 +1,54 @@ ++/** ++@page touchpad_jumping_cursor Touchpad jumping cursor bugs ++ ++A common bug encountered on touchpads is a cursor jump when alternating ++between fingers on a multi-touch-capable touchpad. For example, after moving ++the cursor a user may use a second finger in the software button area to ++physically click the touchpad. Upon setting the finger down, the cursor ++exhibits a jump towards the bottom left or right, depending on the finger ++position. ++ ++When libinput detects a cursor jump it prints a bug warning to the log with ++the text "Touch jump detected and discarded." and a link to this page. ++ ++In most cases, this is a bug in the kernel driver and to libinput it appears ++that the touch point moves from its previous position. The pointer jump can ++usually be seen in the evemu-record output for the device: ++ ++
++ E: 249.206319 0000 0000 0000    # ------------ SYN_REPORT (0) ----------
++ E: 249.218008 0003 0035 3764    # EV_ABS / ABS_MT_POSITION_X    3764
++ E: 249.218008 0003 0036 2221    # EV_ABS / ABS_MT_POSITION_Y    2221
++ E: 249.218008 0003 003a 0065    # EV_ABS / ABS_MT_PRESSURE      65
++ E: 249.218008 0003 0000 3764    # EV_ABS / ABS_X                3764
++ E: 249.218008 0003 0001 2216    # EV_ABS / ABS_Y                2216
++ E: 249.218008 0003 0018 0065    # EV_ABS / ABS_PRESSURE         65
++ E: 249.218008 0000 0000 0000    # ------------ SYN_REPORT (0) ----------
++ E: 249.230881 0003 0035 3752    # EV_ABS / ABS_MT_POSITION_X    3752
++ E: 249.230881 0003 003a 0046    # EV_ABS / ABS_MT_PRESSURE      46
++ E: 249.230881 0003 0000 3758    # EV_ABS / ABS_X                3758
++ E: 249.230881 0003 0018 0046    # EV_ABS / ABS_PRESSURE         46
++ E: 249.230881 0000 0000 0000    # ------------ SYN_REPORT (0) ----------
++ E: 249.242648 0003 0035 1640    # EV_ABS / ABS_MT_POSITION_X    1640
++ E: 249.242648 0003 0036 4681    # EV_ABS / ABS_MT_POSITION_Y    4681
++ E: 249.242648 0003 003a 0025    # EV_ABS / ABS_MT_PRESSURE      25
++ E: 249.242648 0003 0000 1640    # EV_ABS / ABS_X                1640
++ E: 249.242648 0003 0001 4681    # EV_ABS / ABS_Y                4681
++ E: 249.242648 0003 0018 0025    # EV_ABS / ABS_PRESSURE         25
++ E: 249.242648 0000 0000 0000    # ------------ SYN_REPORT (0) ----------
++ E: 249.254568 0003 0035 1648    # EV_ABS / ABS_MT_POSITION_X    1648
++ E: 249.254568 0003 003a 0027    # EV_ABS / ABS_MT_PRESSURE      27
++ E: 249.254568 0003 0000 1644    # EV_ABS / ABS_X                1644
++ E: 249.254568 0003 0018 0027    # EV_ABS / ABS_PRESSURE         27
++
++ ++In this recording, the pointer jumps from its position 3752/2216 to ++1640/4681 within a single frame. On this particular touchpad, this would ++represent a physical move of almost 50mm. libinput detects some of these ++jumps and discards the movement but otherwise continues as usual. However, ++the bug should be fixed at the kernel level. ++ ++When you encounter the warning in the log, please generate an evemu ++recording of your touchpad and file a bug. See @ref reporting_bugs for more ++details. ++*/ +diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c +index 2ab6fd3..c50f52d 100644 +--- a/src/evdev-mt-touchpad.c ++++ b/src/evdev-mt-touchpad.c +@@ -918,6 +918,25 @@ tp_need_motion_history_reset(struct tp_dispatch *tp, uint64_t time) + return rc; + } + ++static bool ++tp_detect_jumps(const struct tp_dispatch *tp, struct tp_touch *t) ++{ ++ struct device_coords *last; ++ double dx, dy; ++ const int JUMP_THRESHOLD_MM = 20; ++ ++ if (t->history.count == 0) ++ return false; ++ ++ /* called before tp_motion_history_push, so offset 0 is the most ++ * recent coordinate */ ++ last = tp_motion_history_offset(t, 0); ++ dx = fabs(t->point.x - last->x) / tp->device->abs.absinfo_x->resolution; ++ dy = fabs(t->point.y - last->y) / tp->device->abs.absinfo_y->resolution; ++ ++ return hypot(dx, dy) > JUMP_THRESHOLD_MM; ++} ++ + static void + tp_process_state(struct tp_dispatch *tp, uint64_t time) + { +@@ -946,6 +965,14 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) + if (!t->dirty) + continue; + ++ if (tp_detect_jumps(tp, t)) { ++ log_bug_kernel(tp_libinput_context(tp), ++ "Touch jump detected and discarded.\n" ++ "See %stouchpad_jumping_cursor for details\n", ++ HTTP_DOC_LINK); ++ tp_motion_history_reset(t); ++ } ++ + tp_thumb_detect(tp, t, time); + tp_palm_detect(tp, t, time); + +diff --git a/test/touchpad.c b/test/touchpad.c +index be9c566..8744cbd 100644 +--- a/test/touchpad.c ++++ b/test/touchpad.c +@@ -3958,6 +3958,43 @@ START_TEST(touchpad_time_usec) + } + END_TEST + ++START_TEST(touchpad_jump_finger_motion) ++{ ++ struct litest_device *dev = litest_current_device(); ++ struct libinput *li = dev->libinput; ++ struct libinput_event *event; ++ struct libinput_event_pointer *ptrev; ++ ++ litest_touch_down(dev, 0, 20, 30); ++ litest_touch_move_to(dev, 0, 20, 30, 90, 30, 10, 0); ++ litest_drain_events(li); ++ ++ litest_disable_log_handler(li); ++ litest_touch_move_to(dev, 0, 90, 30, 20, 80, 1, 0); ++ litest_assert_empty_queue(li); ++ litest_restore_log_handler(li); ++ ++ litest_touch_move_to(dev, 0, 20, 80, 21, 81, 10, 0); ++ litest_touch_up(dev, 0); ++ ++ /* expect lots of little events, no big jump */ ++ libinput_dispatch(li); ++ event = libinput_get_event(li); ++ do { ++ double dx, dy; ++ ++ ptrev = litest_is_motion_event(event); ++ dx = libinput_event_pointer_get_dx(ptrev); ++ dy = libinput_event_pointer_get_dy(ptrev); ++ ck_assert_int_lt(abs(dx), 20); ++ ck_assert_int_lt(abs(dy), 20); ++ ++ libinput_event_destroy(event); ++ event = libinput_get_event(li); ++ } while (event != NULL); ++} ++END_TEST ++ + void + litest_setup_tests(void) + { +@@ -4077,4 +4114,6 @@ litest_setup_tests(void) + litest_add_for_device("touchpad:bugs", touchpad_tool_tripletap_touch_count, LITEST_SYNAPTICS_TOPBUTTONPAD); + + litest_add("touchpad:time", touchpad_time_usec, LITEST_TOUCHPAD, LITEST_ANY); ++ ++ litest_add_for_device("touchpad:jumps", touchpad_jump_finger_motion, LITEST_SYNAPTICS_CLICKPAD); + } +-- +2.7.4 + diff --git a/libinput.spec b/libinput.spec index 1f4d89e..6609811 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.2.4 -Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -20,6 +20,8 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version} # Not upstream, keep until kernel 4.2 or 4.1.x with dbf3c37086 Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch +Patch02: 0001-Make-a-link-to-the-html-docs-available-as-a-define.patch +Patch03: 0001-touchpad-detect-and-warn-about-kernel-tracking-point.patch BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig @@ -97,6 +99,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Thu May 12 2016 Peter Hutterer 1.2.4-2 +- discard large cursor jumps (#1335307) + * Tue Apr 19 2016 Peter Hutterer 1.2.4-1 - libinput 1.2.4 From c4869e79dd3dee5999bb8081944aa257b76cb75b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 19 May 2016 14:44:10 +1000 Subject: [PATCH 10/11] Fix pointer jitter on the Dell E5420 (#1336084) --- ...INPUT_MODEL_WOBBLY_TOUCHPAD-for-the-.patch | 81 +++++++++++++++++++ ...l-Lattitude-E5420-to-the-wobbly-touc.patch | 31 +++++++ libinput.spec | 9 ++- 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 0001-touchpad-add-LIBINPUT_MODEL_WOBBLY_TOUCHPAD-for-the-.patch create mode 100644 0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch diff --git a/0001-touchpad-add-LIBINPUT_MODEL_WOBBLY_TOUCHPAD-for-the-.patch b/0001-touchpad-add-LIBINPUT_MODEL_WOBBLY_TOUCHPAD-for-the-.patch new file mode 100644 index 0000000..7a843bd --- /dev/null +++ b/0001-touchpad-add-LIBINPUT_MODEL_WOBBLY_TOUCHPAD-for-the-.patch @@ -0,0 +1,81 @@ +From 71841c822cb3cc7069f6a1a834b005fdf0403c69 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 12 Apr 2016 11:07:02 +1000 +Subject: [PATCH libinput] touchpad: add LIBINPUT_MODEL_WOBBLY_TOUCHPAD for the + HP 14-ac157tu + +If some elantech touchpads require a hysteresis, let's use some more generic +tag for those touchpads that require correct handling of pointer wobbles. + +https://bugs.freedesktop.org/show_bug.cgi?id=94897 + +Signed-off-by: Peter Hutterer +Reviewed-by: Hans de Goede +(cherry picked from commit afdcaf50157c0a76389740885bed3719b758dc37) +--- + src/evdev-mt-touchpad.c | 3 +++ + src/evdev.c | 1 + + src/evdev.h | 1 + + udev/90-libinput-model-quirks.hwdb | 8 ++++++++ + 4 files changed, 13 insertions(+) + +diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c +index c50f52d..a92e60b 100644 +--- a/src/evdev-mt-touchpad.c ++++ b/src/evdev-mt-touchpad.c +@@ -2046,6 +2046,9 @@ tp_init_hysteresis(struct tp_dispatch *tp) + (tp->device->model_flags & EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD)) + goto want_hysteresis; + ++ if (tp->device->model_flags & EVDEV_MODEL_WOBBLY_TOUCHPAD) ++ goto want_hysteresis; ++ + tp->hysteresis_margin.x = 0; + tp->hysteresis_margin.y = 0; + +diff --git a/src/evdev.c b/src/evdev.c +index 6bb8986..f0311c6 100644 +--- a/src/evdev.c ++++ b/src/evdev.c +@@ -1681,6 +1681,7 @@ evdev_read_model_flags(struct evdev_device *device) + { "LIBINPUT_MODEL_CYAPA", EVDEV_MODEL_CYAPA }, + { "LIBINPUT_MODEL_ALPS_RUSHMORE", EVDEV_MODEL_ALPS_RUSHMORE }, + { "LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD", EVDEV_MODEL_LENOVO_T450_TOUCHPAD }, ++ { "LIBINPUT_MODEL_WOBBLY_TOUCHPAD", EVDEV_MODEL_WOBBLY_TOUCHPAD }, + { NULL, EVDEV_MODEL_DEFAULT }, + }; + const struct model_map *m = model_map; +diff --git a/src/evdev.h b/src/evdev.h +index 4a5d807..3a7693e 100644 +--- a/src/evdev.h ++++ b/src/evdev.h +@@ -114,6 +114,7 @@ enum evdev_device_model { + EVDEV_MODEL_CYAPA = (1 << 15), + EVDEV_MODEL_ALPS_RUSHMORE = (1 << 16), + EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), ++ EVDEV_MODEL_WOBBLY_TOUCHPAD = (1 << 18), + }; + + struct mt_slot { +diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb +index 242c444..91ac243 100644 +--- a/udev/90-libinput-model-quirks.hwdb ++++ b/udev/90-libinput-model-quirks.hwdb +@@ -81,6 +81,14 @@ libinput:name:Cypress APA Trackpad ?cyapa?:dmi:* + LIBINPUT_MODEL_CYAPA=1 + + ########################################## ++# HP ++########################################## ++ ++# HP 14-ac157tu ++libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*svnHP*pvrCNB1:* ++ LIBINPUT_MODEL_WOBBLY_TOUCHPAD=1 ++ ++########################################## + # LENOVO + ########################################## + +-- +2.7.4 + diff --git a/0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch b/0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch new file mode 100644 index 0000000..0eae21f --- /dev/null +++ b/0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch @@ -0,0 +1,31 @@ +From 133b96101acebf2a86c4aad59ed9f3f926936091 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Thu, 19 May 2016 14:40:33 +1000 +Subject: [PATCH libinput] udev: add the Dell Lattitude E5420 to the wobbly + touchpads + +https://bugzilla.redhat.com/show_bug.cgi?id=1336084 + +Signed-off-by: Peter Hutterer +(cherry picked from commit bd988633c788c9cce7bf537585ef221d31d7bcfb) +--- + udev/90-libinput-model-quirks.hwdb | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb +index 91ac243..7dc4084 100644 +--- a/udev/90-libinput-model-quirks.hwdb ++++ b/udev/90-libinput-model-quirks.hwdb +@@ -30,6 +30,9 @@ libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:310 + libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:310 + LIBINPUT_MODEL_ALPS_RUSHMORE=1 + ++libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:dmi:*svnDellInc.:pnLatitudeE5420* ++ LIBINPUT_MODEL_WOBBLY_TOUCHPAD=1 ++ + ########################################## + # Apple + ########################################## +-- +2.7.4 + diff --git a/libinput.spec b/libinput.spec index 6609811..9e10db5 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.2.4 -Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -23,6 +23,10 @@ Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch Patch02: 0001-Make-a-link-to-the-html-docs-available-as-a-define.patch Patch03: 0001-touchpad-detect-and-warn-about-kernel-tracking-point.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1336084 +Patch04: 0001-touchpad-add-LIBINPUT_MODEL_WOBBLY_TOUCHPAD-for-the-.patch +Patch05: 0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch + BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel @@ -99,6 +103,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Fri May 20 2016 Peter Hutterer 1.2.4-3 +- Fix pointer jitter on the Dell E5420 (#1336084) + * Thu May 12 2016 Peter Hutterer 1.2.4-2 - discard large cursor jumps (#1335307) From 938d440a6c09bd5495068bbebda2983426f8e847 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 23 May 2016 14:35:54 +1000 Subject: [PATCH 11/11] Fix pointer jitter on ALPS FW v300 (#1336084) --- ...l-Lattitude-E5420-to-the-wobbly-touc.patch | 31 ---------------- ...ouchpads-fw-version-300-as-wobbly-to.patch | 35 +++++++++++++++++++ libinput.spec | 7 ++-- 3 files changed, 40 insertions(+), 33 deletions(-) delete mode 100644 0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch create mode 100644 0001-udev-mark-ALPS-touchpads-fw-version-300-as-wobbly-to.patch diff --git a/0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch b/0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch deleted file mode 100644 index 0eae21f..0000000 --- a/0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 133b96101acebf2a86c4aad59ed9f3f926936091 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 19 May 2016 14:40:33 +1000 -Subject: [PATCH libinput] udev: add the Dell Lattitude E5420 to the wobbly - touchpads - -https://bugzilla.redhat.com/show_bug.cgi?id=1336084 - -Signed-off-by: Peter Hutterer -(cherry picked from commit bd988633c788c9cce7bf537585ef221d31d7bcfb) ---- - udev/90-libinput-model-quirks.hwdb | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb -index 91ac243..7dc4084 100644 ---- a/udev/90-libinput-model-quirks.hwdb -+++ b/udev/90-libinput-model-quirks.hwdb -@@ -30,6 +30,9 @@ libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:310 - libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:310 - LIBINPUT_MODEL_ALPS_RUSHMORE=1 - -+libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:dmi:*svnDellInc.:pnLatitudeE5420* -+ LIBINPUT_MODEL_WOBBLY_TOUCHPAD=1 -+ - ########################################## - # Apple - ########################################## --- -2.7.4 - diff --git a/0001-udev-mark-ALPS-touchpads-fw-version-300-as-wobbly-to.patch b/0001-udev-mark-ALPS-touchpads-fw-version-300-as-wobbly-to.patch new file mode 100644 index 0000000..c009043 --- /dev/null +++ b/0001-udev-mark-ALPS-touchpads-fw-version-300-as-wobbly-to.patch @@ -0,0 +1,35 @@ +From 31b1e9e619ebe3281a4659590d7318225b81bd97 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Thu, 19 May 2016 14:40:33 +1000 +Subject: [PATCH libinput] udev: mark ALPS touchpads fw version 300 as wobbly + touchpads + +Includes the Dell Lattitude E5420 but since all alps touchpads with the same +fw version are the same (as far as we know) hooking this off the firmware +version should cover this generation. + +https://bugzilla.redhat.com/show_bug.cgi?id=1336084 + +Signed-off-by: Peter Hutterer +--- + udev/90-libinput-model-quirks.hwdb | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb +index 147fec2..305fed0 100644 +--- a/udev/90-libinput-model-quirks.hwdb ++++ b/udev/90-libinput-model-quirks.hwdb +@@ -26,6 +26,10 @@ libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:800 + libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:800 + LIBINPUT_ATTR_SIZE_HINT=100x55 + ++libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:300 ++libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:300 ++ LIBINPUT_MODEL_WOBBLY_TOUCHPAD=1 ++ + libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:310 + libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:310 + LIBINPUT_MODEL_ALPS_RUSHMORE=1 +-- +2.7.4 + diff --git a/libinput.spec b/libinput.spec index 9e10db5..a51d5ec 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.2.4 -Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -25,7 +25,7 @@ Patch03: 0001-touchpad-detect-and-warn-about-kernel-tracking-point.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1336084 Patch04: 0001-touchpad-add-LIBINPUT_MODEL_WOBBLY_TOUCHPAD-for-the-.patch -Patch05: 0001-udev-add-the-Dell-Lattitude-E5420-to-the-wobbly-touc.patch +Patch05: 0001-udev-mark-ALPS-touchpads-fw-version-300-as-wobbly-to.patch BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig @@ -103,6 +103,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Mon May 23 2016 Peter Hutterer 1.2.4-4 +- Fix pointer jitter on ALPS FW v300 (#1336084) + * Fri May 20 2016 Peter Hutterer 1.2.4-3 - Fix pointer jitter on the Dell E5420 (#1336084)