From 776a5cf3747e1cbddfec3ca6634c20fa13b8b3b0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 2 Nov 2016 09:40:42 +1000 Subject: [PATCH libinput] touchpad: add a quirk for the HP Pavilion dm4 This touchpad has cursor jumps for 2-finger scrolling that also affects the single-finger emulation. So disable any multitouch bits on this device and disallow the 2-finger scroll method. This still allows for 2-finger tapping/clicking. https://bugs.freedesktop.org/show_bug.cgi?id=91135 Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 6 ++++++ src/evdev.c | 12 ++++++++++++ src/evdev.h | 1 + udev/90-libinput-model-quirks.hwdb | 4 ++++ 4 files changed, 23 insertions(+) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index d72cb19..beb19cd 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1909,6 +1909,12 @@ tp_scroll_get_methods(struct tp_dispatch *tp) { uint32_t methods = LIBINPUT_CONFIG_SCROLL_EDGE; + /* Any movement with more than one finger has random cursor + * jumps. Don't allow for 2fg scrolling on this device, see + * fdo bug 91135 */ + if (tp->device->model_flags & EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD) + return LIBINPUT_CONFIG_SCROLL_EDGE; + if (tp->ntouches >= 2) methods |= LIBINPUT_CONFIG_SCROLL_2FG; diff --git a/src/evdev.c b/src/evdev.c index d49b391..3b3d142 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2143,6 +2143,7 @@ evdev_read_model_flags(struct evdev_device *device) MODEL(TRACKBALL), MODEL(APPLE_MAGICMOUSE), MODEL(HP8510_TOUCHPAD), + MODEL(HP_PAVILION_DM4_TOUCHPAD), #undef MODEL { "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL }, { NULL, EVDEV_MODEL_DEFAULT }, @@ -2724,6 +2725,17 @@ evdev_pre_configure_model_quirks(struct evdev_device *device) if (device->model_flags & EVDEV_MODEL_HP_STREAM11_TOUCHPAD) libevdev_enable_property(device->evdev, INPUT_PROP_BUTTONPAD); + + /* Touchpad has random jumps in slots, including for single-finger + * movement. See fdo bug 91135 */ + if (device->model_flags & EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD) { + unsigned int code; + + for (code = ABS_MT_SLOT; code <= ABS_MT_TRACKING_ID; code++) + libevdev_disable_event_code(device->evdev, + EV_ABS, + code); + } } struct evdev_device * diff --git a/src/evdev.h b/src/evdev.h index 4e28e05..f21a194 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -120,6 +120,7 @@ enum evdev_device_model { EVDEV_MODEL_TRACKBALL = (1 << 19), EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20), EVDEV_MODEL_HP8510_TOUCHPAD = (1 << 21), + EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD = (1 << 22), }; struct mt_slot { diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb index fed28e2..e4faa57 100644 --- a/udev/90-libinput-model-quirks.hwdb +++ b/udev/90-libinput-model-quirks.hwdb @@ -95,6 +95,10 @@ libinput:name:Cypress APA Trackpad ?cyapa?:dmi:* libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq8510w* LIBINPUT_MODEL_HP8510_TOUCHPAD=1 +# HP Pavillion dm4 +libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPPaviliondm4NotebookPC* + LIBINPUT_MODEL_HP_PAVILLION_DM4_TOUCHPAD=1 + # HP Stream 11 libinput:name:SYN1EDE:00 06CB:7442:dmi:*svnHewlett-Packard:pnHPStreamNotebookPC11* LIBINPUT_MODEL_HP_STREAM11_TOUCHPAD=1 -- 2.9.3