From 8d73275166d677a8672ad245d61a0316b1c54a44 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Jun 2016 16:08:30 +1000 Subject: 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(-) (limited to 'src') 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)) { -- cgit v1.2.3 From 89747d714356b5225592355d8ef1c83a59b2c5f7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Jun 2016 16:10:21 +1000 Subject: 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 | 34 +++++++++------------------------- test/litest.h | 7 ------- test/touchpad.c | 2 +- 5 files changed, 10 insertions(+), 38 deletions(-) (limited to 'src') 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 @@ -1502,39 +1502,23 @@ litest_touch_move_extended(struct litest_device *d, } 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) +litest_touch_move_to(struct litest_device *d, + unsigned int slot, + double x_from, double y_from, + double x_to, double y_to, + 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); + 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_extended(d, slot, x_to, y_to, axes); -} - -void -litest_touch_move_to(struct litest_device *d, - unsigned int slot, - double x_from, double y_from, - 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); + 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); } -- cgit v1.2.3 From 48473994c8e60189356feae7b7eae25288e5ac28 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Jun 2016 16:11:56 +1000 Subject: 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(-) (limited to 'src') 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 -- cgit v1.2.3