All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Loic Poulain <loic.poulain@linaro.org>,
	Peter Hutterer <peter.hutterer@who-t.net>
Cc: nick@shmanahar.org, linux-input@vger.kernel.org
Subject: Re: [PATCH 2/2] Input: atmel_mxt_ts: atmel_mxt_ts: Fix event loss
Date: Wed, 23 Jun 2021 17:48:49 -0700	[thread overview]
Message-ID: <YNPWcXkG4gCBmmeT@google.com> (raw)
In-Reply-To: <1624456597-9486-2-git-send-email-loic.poulain@linaro.org>

On Wed, Jun 23, 2021 at 03:56:37PM +0200, Loic Poulain wrote:
> If both touch events and release are part of the same report,
> userspace will not consider it as a touch-down & touch-up but as
> a non-action. That can happen on resume when 'buffered' events are
> dequeued in a row.
> 
> Make sure that release always causes previous events to be synced
> before being reported.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
>  drivers/input/touchscreen/atmel_mxt_ts.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 807f449..e05ec30 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -990,6 +990,13 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message)
>  		input_report_abs(input_dev, ABS_MT_DISTANCE, distance);
>  		input_report_abs(input_dev, ABS_MT_ORIENTATION, orientation);
>  	} else {
> +		/*
> +		 * Always sync input before reporting release, to be sure
> +		 * previous event(s) are taking into account by user side.
> +		 */
> +		if (data->update_input)
> +			mxt_input_sync(data);

That means we sync for every contact release, whereas I think ideal
would be to only sync when we observe touch-down and touch-up in the
same slot.

Let's also add Peter to the conversation...

> +
>  		dev_dbg(dev, "[%u] release\n", id);
>  
>  		/* close out slot */
> -- 
> 2.7.4
> 

Thanks.

-- 
Dmitry

  reply	other threads:[~2021-06-24  0:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 13:56 [PATCH 1/2] Input: atmel_mxt_ts: Add wake-up support Loic Poulain
2021-06-23 13:56 ` [PATCH 2/2] Input: atmel_mxt_ts: atmel_mxt_ts: Fix event loss Loic Poulain
2021-06-24  0:48   ` Dmitry Torokhov [this message]
2021-06-24  5:57     ` Peter Hutterer
2021-06-24  8:05       ` Loic Poulain
2021-06-24  0:41 ` [PATCH 1/2] Input: atmel_mxt_ts: Add wake-up support Dmitry Torokhov
2021-06-24  7:56   ` Loic Poulain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YNPWcXkG4gCBmmeT@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=nick@shmanahar.org \
    --cc=peter.hutterer@who-t.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.