From dd73c5391e000a71748d0c7ec8b3ae57e318bc1f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Jun 2016 16:37:29 +1000 Subject: [PATCH 1/4] Revert "test: add a test for the T450 dropped motion events" This reverts commit b5527fa4c73da687774971ddd7cf6ad2016f89e7. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- test/touchpad.c | 67 ------------------------------------------------- 1 file changed, 67 deletions(-) diff --git a/test/touchpad.c b/test/touchpad.c index 0b1cd0e9..4255840f 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -3980,72 +3980,6 @@ START_TEST(touchpad_tool_tripletap_touch_count) } END_TEST -START_TEST(touchpad_t450_motion_drops) -{ - struct litest_device *dev = litest_current_device(); - struct libinput *li = dev->libinput; - struct libinput_event *event; - struct libinput_event_pointer *ptrev; - int i; - double d; - - /* In some areas on the touchpad we only get pressure events. - * https://bugs.freedesktop.org/show_bug.cgi?id=94379 - */ - litest_drain_events(li); - - litest_touch_down(dev, 0, 50, 50); - - for (i = 0; i < 10; i++) { - litest_event(dev, EV_ABS, ABS_MT_SLOT, 0); - litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 3000 - i); - litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 3000 - i); - litest_event(dev, EV_ABS, ABS_MT_PRESSURE, 30); - litest_event(dev, EV_ABS, ABS_X, 3000 - i); - litest_event(dev, EV_ABS, ABS_Y, 3000 - i); - litest_event(dev, EV_ABS, ABS_PRESSURE, 30); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - litest_drain_events(li); - } - - /* several pressure-only events */ - - for (i = 0; i< 20; i++) { - litest_event(dev, EV_ABS, ABS_MT_PRESSURE, 30 + i % 2); - litest_event(dev, EV_ABS, ABS_PRESSURE, 30 + i % 2); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - litest_assert_empty_queue(li); - } - - /* a 100 unit jump followed by fine-grained motion, we expect small - * motions without the jump */ - - for (i = 0; i < 10; i++) { - litest_event(dev, EV_ABS, ABS_MT_SLOT, 0); - litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 3100 + i); - litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 3100 + i); - litest_event(dev, EV_ABS, ABS_X, 3100 + i); - litest_event(dev, EV_ABS, ABS_Y, 3100 + i); - litest_event(dev, EV_ABS, ABS_PRESSURE, 30); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - libinput_dispatch(li); - } - - event = libinput_get_event(li); - ck_assert_notnull(event); - while (event) { - ptrev = litest_is_motion_event(event); - d = libinput_event_pointer_get_dx(ptrev); - litest_assert_double_lt(d, 1.0); - d = libinput_event_pointer_get_dy(ptrev); - litest_assert_double_lt(d, 1.0); - libinput_event_destroy(event); - - event = libinput_get_event(li); - } -} -END_TEST - START_TEST(touchpad_time_usec) { struct litest_device *dev = litest_current_device(); @@ -4236,7 +4170,6 @@ litest_setup_tests(void) litest_add("touchpad:thumb", touchpad_thumb_tap_hold_2ndfg_tap, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH); litest_add_for_device("touchpad:bugs", touchpad_tool_tripletap_touch_count, LITEST_SYNAPTICS_TOPBUTTONPAD); - litest_add_for_device("touchpad:bugs", touchpad_t450_motion_drops, LITEST_SYNAPTICS_TRACKPOINT_BUTTONS); litest_add("touchpad:time", touchpad_time_usec, LITEST_TOUCHPAD, LITEST_ANY); From 8d73275166d677a8672ad245d61a0316b1c54a44 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Jun 2016 16:08:30 +1000 Subject: [PATCH 2/4] Revert "touchpad: only use negative pressure change check on Lenovo *50 and *60 series" We will reinstate the hysteresis for all devices making the negative pressure check unncessary and thus this commit as well. This reverts commit 2f5231cc88fccf389a78270d827f6c9201b86794. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/evdev-mt-touchpad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index fdc53192..1a58d5e2 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1018,7 +1018,6 @@ tp_detect_jumps(const struct tp_dispatch *tp, struct tp_touch *t) static void tp_process_state(struct tp_dispatch *tp, uint64_t time) { - struct evdev_device *device = tp->device; struct tp_touch *t; unsigned int i; bool restart_filter = false; @@ -1044,8 +1043,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) if (!t->dirty) continue; - if ((device->model_flags & EVDEV_MODEL_LENOVO_T450_TOUCHPAD) && - t->pressure_delta < -7) + if (t->pressure_delta < -7) tp_motion_history_reset(t); if (tp_detect_jumps(tp, t)) { From 89747d714356b5225592355d8ef1c83a59b2c5f7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Jun 2016 16:10:21 +1000 Subject: [PATCH 3/4] Revert "touchpad: reset the motion history on significant negative pressure changes" We will reinstate the hysteresis for all devices making the negative pressure check unncessary. This reverts commit ef48c07a9600733e068a2a437a145862ba07fdab. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/evdev-mt-touchpad.c | 4 ---- src/evdev-mt-touchpad.h | 1 - test/litest.c | 38 +++++++++++--------------------------- test/litest.h | 7 ------- test/touchpad.c | 2 +- 5 files changed, 12 insertions(+), 40 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 1a58d5e2..eb3c4dd3 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -357,7 +357,6 @@ tp_process_absolute(struct tp_dispatch *tp, tp_end_sequence(tp, t, time); break; case ABS_MT_PRESSURE: - t->pressure_delta = e->value - t->pressure; t->pressure = e->value; t->dirty = true; tp->queued |= TOUCHPAD_EVENT_OTHERAXIS; @@ -1043,9 +1042,6 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) if (!t->dirty) continue; - if (t->pressure_delta < -7) - tp_motion_history_reset(t); - if (tp_detect_jumps(tp, t)) { if (!tp->semi_mt) log_bug_kernel(tp_libinput_context(tp), diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index cbb9fb0e..3f3b728a 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -155,7 +155,6 @@ struct tp_touch { uint64_t millis; int distance; /* distance == 0 means touch */ int pressure; - int pressure_delta; struct { /* A quirk mostly used on Synaptics touchpads. In a diff --git a/test/litest.c b/test/litest.c index 66f08f20..0bd21bda 100644 --- a/test/litest.c +++ b/test/litest.c @@ -1501,28 +1501,6 @@ litest_touch_move_extended(struct litest_device *d, litest_slot_move(d, slot, x, y, axes, true); } -void -litest_touch_move_to_extended(struct litest_device *d, - unsigned int slot, - double x_from, double y_from, - double x_to, double y_to, - struct axis_replacement *axes, - int steps, int sleep_ms) -{ - for (int i = 0; i < steps - 1; i++) { - litest_touch_move_extended(d, slot, - x_from + (x_to - x_from)/steps * i, - y_from + (y_to - y_from)/steps * i, - axes); - if (sleep_ms) { - libinput_dispatch(d->libinput); - msleep(sleep_ms); - libinput_dispatch(d->libinput); - } - } - litest_touch_move_extended(d, slot, x_to, y_to, axes); -} - void litest_touch_move_to(struct litest_device *d, unsigned int slot, @@ -1530,11 +1508,17 @@ litest_touch_move_to(struct litest_device *d, double x_to, double y_to, int steps, int sleep_ms) { - litest_touch_move_to_extended(d, slot, - x_from, y_from, - x_to, y_to, - NULL, - steps, sleep_ms); + for (int i = 0; i < steps - 1; i++) { + litest_touch_move(d, slot, + x_from + (x_to - x_from)/steps * i, + y_from + (y_to - y_from)/steps * i); + if (sleep_ms) { + libinput_dispatch(d->libinput); + msleep(sleep_ms); + libinput_dispatch(d->libinput); + } + } + litest_touch_move(d, slot, x_to, y_to); } static int diff --git a/test/litest.h b/test/litest.h index a7e8607f..76e7df7c 100644 --- a/test/litest.h +++ b/test/litest.h @@ -411,13 +411,6 @@ litest_touch_move_to(struct litest_device *d, double x_from, double y_from, double x_to, double y_to, int steps, int sleep_ms); -void -litest_touch_move_to_extended(struct litest_device *d, - unsigned int slot, - double x_from, double y_from, - double x_to, double y_to, - struct axis_replacement *axes, - int steps, int sleep_ms); void litest_touch_move_two_touches(struct litest_device *d, diff --git a/test/touchpad.c b/test/touchpad.c index 4255840f..5c632029 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -3650,7 +3650,7 @@ START_TEST(touchpad_thumb_edgescroll) libinput_dispatch(li); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS); - litest_touch_move_to_extended(dev, 0, 99, 55, 99, 70, axes, 10, 0); + litest_touch_move_to(dev, 0, 99, 55, 99, 70, 10, 0); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS); } From 48473994c8e60189356feae7b7eae25288e5ac28 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Jun 2016 16:11:56 +1000 Subject: [PATCH 4/4] touchpad: re-enable hysteresis by default for all devices The removal of the hysteresis even on precise touchpads has led to difficulties controlling the cursor in a few instances. Since 27078b2667d we only have the hysteresis on Apple touchpads and the Lenovo *40 series and later. Even on those do we see some positioning difficulties (bug 94379). So restore the hysteresis by default again for all touchpads. In the future a knob could be exposed for precision vs reactivity or something, but for now the drawback of imprecise positioning does not outweigh the benefits we get on those few devices. https://bugs.freedesktop.org/show_bug.cgi?id=94379 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/evdev-mt-touchpad.c | 6 ------ src/evdev.c | 1 - src/evdev.h | 1 - test/litest-device-synaptics-x1-carbon-3rd.c | 1 - udev/90-libinput-model-quirks.hwdb | 2 -- 5 files changed, 11 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index eb3c4dd3..96e78b94 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -2118,12 +2118,6 @@ tp_init_hysteresis(struct tp_dispatch *tp) { int res_x, res_y; - tp->hysteresis_margin.x = 0; - tp->hysteresis_margin.y = 0; - - if (tp->device->model_flags & EVDEV_MODEL_PRECISE_TOUCHPAD) - return; - res_x = tp->device->abs.absinfo_x->resolution; res_y = tp->device->abs.absinfo_y->resolution; tp->hysteresis_margin.x = res_x/2; diff --git a/src/evdev.c b/src/evdev.c index e18492aa..13e35784 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1804,7 +1804,6 @@ evdev_read_model_flags(struct evdev_device *device) MODEL(CYBORG_RAT), MODEL(CYAPA), MODEL(LENOVO_T450_TOUCHPAD), - MODEL(PRECISE_TOUCHPAD), MODEL(TRACKBALL), { NULL, EVDEV_MODEL_DEFAULT }, #undef MODEL diff --git a/src/evdev.h b/src/evdev.h index 99e3b73c..eae9ba95 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -114,7 +114,6 @@ enum evdev_device_model { EVDEV_MODEL_CYBORG_RAT = (1 << 14), EVDEV_MODEL_CYAPA = (1 << 15), EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), - EVDEV_MODEL_PRECISE_TOUCHPAD = (1 << 18), EVDEV_MODEL_TRACKBALL = (1 << 19), }; diff --git a/test/litest-device-synaptics-x1-carbon-3rd.c b/test/litest-device-synaptics-x1-carbon-3rd.c index 9d4034db..23d9c5b4 100644 --- a/test/litest-device-synaptics-x1-carbon-3rd.c +++ b/test/litest-device-synaptics-x1-carbon-3rd.c @@ -121,7 +121,6 @@ static const char udev_rule[] = "\n" "ATTRS{name}==\"litest SynPS/2 Synaptics TouchPad X1C3rd\"," " ENV{LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD}=\"1\"\n" -" ENV{LIBINPUT_MODEL_PRECISE_TOUCHPAD}=\"1\"\n" "\n" "LABEL=\"touchpad_end\""; diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb index 821bc162..1571abce 100644 --- a/udev/90-libinput-model-quirks.hwdb +++ b/udev/90-libinput-model-quirks.hwdb @@ -32,7 +32,6 @@ libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:800 libinput:touchpad:input:b0003v05ACp* libinput:touchpad:input:b0005v05ACp* LIBINPUT_MODEL_APPLE_TOUCHPAD=1 - LIBINPUT_MODEL_PRECISE_TOUCHPAD=1 LIBINPUT_ATTR_SIZE_HINT=104x75 libinput:name:*Apple Inc. Apple Internal Keyboard*:dmi:* @@ -103,7 +102,6 @@ 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 - LIBINPUT_MODEL_PRECISE_TOUCHPAD=1 ########################################## # Logitech