[PATCH libinput] touchpad: restore the hysteresis by default

Hans de Goede hdegoede at redhat.com
Fri Jun 3 10:49:45 UTC 2016


Hi,

On 03-06-16 03:59, Peter Hutterer wrote:
> A large part of the bugs seen right now are related to touchpads jittering too
> much. Fixing them one by one is entertaining but time consuming. Right now
> the number of touchpads that require a hysteresis seem to outnumber those that
> don't, so invert the approach: leave the hysteresis enabled by default but
> disable it for those touchpads that don't need it.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Seems like the sensible thing to do to me, and the patch looks good:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans

p.s.

We should try to paint with big strokes when it comes to setting
the new EVDEV_MODEL_PRECISE_TOUCHPAD flag. E.g. since Benjamin
is getting close to getting smbus support for the synaptics
touchpads merged, I can envision a check like this:

if (bus == smbus && vendor == synaptics)
	tp->device->model_flags |= EVDEV_MODEL_PRECISE_TOUCHPAD;

And maybe also:

if (vendor == apple)
	tp->device->model_flags |= EVDEV_MODEL_PRECISE_TOUCHPAD;

I know you're already doing the later in the hwdb, but I wonder
if that covers all apple devices ?


> ---
>  src/evdev-mt-touchpad.c                      | 16 +++-------------
>  src/evdev.c                                  |  2 +-
>  src/evdev.h                                  |  2 +-
>  test/litest-device-synaptics-x1-carbon-3rd.c |  1 +
>  udev/90-libinput-model-quirks.hwdb           | 20 ++------------------
>  5 files changed, 8 insertions(+), 33 deletions(-)
>
> diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
> index a7b7a68..724de7f 100644
> --- a/src/evdev-mt-touchpad.c
> +++ b/src/evdev-mt-touchpad.c
> @@ -2076,27 +2076,17 @@ tp_init_hysteresis(struct tp_dispatch *tp)
>  {
>  	int res_x, res_y;
>
> -	if (tp->device->model_flags & EVDEV_MODEL_CYAPA)
> -		goto want_hysteresis;
> -
> -	if (tp->semi_mt &&
> -	    (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;
>
> -	return;
> +	if (tp->device->model_flags & EVDEV_MODEL_PRECISE_TOUCHPAD)
> +		return;
>
> -want_hysteresis:
>  	res_x = tp->device->abs.absinfo_x->resolution;
>  	res_y = tp->device->abs.absinfo_y->resolution;
> -
>  	tp->hysteresis_margin.x = res_x/2;
>  	tp->hysteresis_margin.y = res_y/2;
> +
>  	return;
>  }
>
> diff --git a/src/evdev.c b/src/evdev.c
> index cfb4a91..0227f51 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -1806,7 +1806,7 @@ evdev_read_model_flags(struct evdev_device *device)
>  		MODEL(CYBORG_RAT),
>  		MODEL(CYAPA),
>  		MODEL(LENOVO_T450_TOUCHPAD),
> -		MODEL(WOBBLY_TOUCHPAD),
> +		MODEL(PRECISE_TOUCHPAD),
>  		MODEL(TRACKBALL),
>  		{ NULL, EVDEV_MODEL_DEFAULT },
>  #undef MODEL
> diff --git a/src/evdev.h b/src/evdev.h
> index 4fe2cb9..54d7ce7 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -114,7 +114,7 @@ enum evdev_device_model {
>  	EVDEV_MODEL_CYBORG_RAT = (1 << 14),
>  	EVDEV_MODEL_CYAPA = (1 << 15),
>  	EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
> -	EVDEV_MODEL_WOBBLY_TOUCHPAD = (1 << 18),
> +	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 23d9c5b..9d4034d 100644
> --- a/test/litest-device-synaptics-x1-carbon-3rd.c
> +++ b/test/litest-device-synaptics-x1-carbon-3rd.c
> @@ -121,6 +121,7 @@ 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 a50fa3d..821bc16 100644
> --- a/udev/90-libinput-model-quirks.hwdb
> +++ b/udev/90-libinput-model-quirks.hwdb
> @@ -26,18 +26,13 @@ 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:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:310
> -libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:310
> - LIBINPUT_MODEL_WOBBLY_TOUCHPAD=1
> -
>  ##########################################
>  # Apple
>  ##########################################
>  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:*
> @@ -83,14 +78,6 @@ 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
>  ##########################################
>
> @@ -116,10 +103,7 @@ 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
> -
> -# Lenovo Yoga 2013
> -libinput:name:*SynPS/2 Synaptics TouchPad*:dmi:*svnLENOVO*pvrLenovoYoga213:*
> - LIBINPUT_MODEL_WOBBLY_TOUCHPAD=1
> + LIBINPUT_MODEL_PRECISE_TOUCHPAD=1
>
>  ##########################################
>  # Logitech
>


More information about the wayland-devel mailing list