[PATCH libinput] touchpad: add a quirk for the HP Pavilion dm4
Peter Hutterer
peter.hutterer at who-t.net
Sun Nov 27 22:55:00 UTC 2016
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 <peter.hutterer at who-t.net>
---
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 fac8fcb..eb4c0d0 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2179,6 +2179,7 @@ evdev_read_model_flags(struct evdev_device *device)
MODEL(APPLE_MAGICMOUSE),
MODEL(HP8510_TOUCHPAD),
MODEL(HP6910_TOUCHPAD),
+ MODEL(HP_PAVILION_DM4_TOUCHPAD),
#undef MODEL
{ "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
{ NULL, EVDEV_MODEL_DEFAULT },
@@ -2762,6 +2763,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 b811f51..9689051 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -121,6 +121,7 @@ enum evdev_device_model {
EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
EVDEV_MODEL_HP8510_TOUCHPAD = (1 << 21),
EVDEV_MODEL_HP6910_TOUCHPAD = (1 << 22),
+ EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD = (1 << 23),
};
struct mt_slot {
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 4bfc0f9..d5b1d78 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -99,6 +99,10 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq6910
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_PAVILION_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
List-Unsubscribe: .*localhost.*
More information about the wayland-devel
mailing list