All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: synaptics - reset the ABS_X/Y fuzz after initializing MT axes
@ 2018-01-16  5:34 Peter Hutterer
  2018-01-16 23:41 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Hutterer @ 2018-01-16  5:34 UTC (permalink / raw)
  To: linux-input; +Cc: Benjamin Tissoires, Dmitry Torokhov, Andrew Duggan

input_mt_init_slots() resets the ABS_X/Y fuzz to 0 and expects the driver to
call input_mt_report_pointer_emulation(). That is based on the MT position
bits which are already defuzzed - hence a fuzz of 0.

In the case of synaptics semi-mt devices, we report the ABS_X/Y axes manually.
This results in the MT position being defuzzed but the single-touch emulation
missing that defuzzing.

Work around this by re-initializing the ABS_X/Y axes after the MT axis to
get the same fuzz value back.

https://bugs.freedesktop.org/show_bug.cgi?id=104533

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
Semi-mt devices are Dodos, so I'd rather go for the easy fix here than a
big rewrite of that code.

 drivers/input/mouse/synaptics.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index ee5466a374bf..0e04275e0d74 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1280,6 +1280,14 @@ static void set_input_params(struct psmouse *psmouse,
 				    INPUT_MT_POINTER |
 				    (cr48_profile_sensor ?
 					INPUT_MT_TRACK : INPUT_MT_SEMI_MT));
+
+		/* For semi-mt devices we send ABS_X/Y ourselves instead of
+		 * input_mt_report_pointer_emulation. But
+		 * input_mt_init_slots() resets the fuzz to 0, leading to a
+		 * filtered ABS_MT_POSITION_X but an unfiltered ABS_X
+		 * position. Let's re-initialize ABS_X/Y here. */
+		if (!cr48_profile_sensor)
+			set_abs_position_params(dev, &priv->info, ABS_X, ABS_Y);
 	}
 
 	if (SYN_CAP_PALMDETECT(info->capabilities))
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: synaptics - reset the ABS_X/Y fuzz after initializing MT axes
  2018-01-16  5:34 [PATCH] Input: synaptics - reset the ABS_X/Y fuzz after initializing MT axes Peter Hutterer
@ 2018-01-16 23:41 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2018-01-16 23:41 UTC (permalink / raw)
  To: Peter Hutterer; +Cc: linux-input, Benjamin Tissoires, Andrew Duggan

On Tue, Jan 16, 2018 at 03:34:59PM +1000, Peter Hutterer wrote:
> input_mt_init_slots() resets the ABS_X/Y fuzz to 0 and expects the driver to
> call input_mt_report_pointer_emulation(). That is based on the MT position
> bits which are already defuzzed - hence a fuzz of 0.
> 
> In the case of synaptics semi-mt devices, we report the ABS_X/Y axes manually.
> This results in the MT position being defuzzed but the single-touch emulation
> missing that defuzzing.
> 
> Work around this by re-initializing the ABS_X/Y axes after the MT axis to
> get the same fuzz value back.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=104533
> 
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Applied, thank you.

> ---
> Semi-mt devices are Dodos, so I'd rather go for the easy fix here than a
> big rewrite of that code.
> 
>  drivers/input/mouse/synaptics.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> index ee5466a374bf..0e04275e0d74 100644
> --- a/drivers/input/mouse/synaptics.c
> +++ b/drivers/input/mouse/synaptics.c
> @@ -1280,6 +1280,14 @@ static void set_input_params(struct psmouse *psmouse,
>  				    INPUT_MT_POINTER |
>  				    (cr48_profile_sensor ?
>  					INPUT_MT_TRACK : INPUT_MT_SEMI_MT));
> +
> +		/* For semi-mt devices we send ABS_X/Y ourselves instead of
> +		 * input_mt_report_pointer_emulation. But
> +		 * input_mt_init_slots() resets the fuzz to 0, leading to a
> +		 * filtered ABS_MT_POSITION_X but an unfiltered ABS_X
> +		 * position. Let's re-initialize ABS_X/Y here. */
> +		if (!cr48_profile_sensor)
> +			set_abs_position_params(dev, &priv->info, ABS_X, ABS_Y);
>  	}
>  
>  	if (SYN_CAP_PALMDETECT(info->capabilities))
> -- 
> 2.14.3
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-16 23:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-16  5:34 [PATCH] Input: synaptics - reset the ABS_X/Y fuzz after initializing MT axes Peter Hutterer
2018-01-16 23:41 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.