linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Tai-hwa Liang <avatar@sentelic.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: sentelic - filtering out erratic movement
Date: Wed, 25 Jul 2012 00:08:37 -0700	[thread overview]
Message-ID: <20120725070837.GA15997@core.coreip.homeip.net> (raw)
In-Reply-To: <1341553769-30324-1-git-send-email-avatar@sentelic.com>

Hi Tai-hwa,

On Fri, Jul 06, 2012 at 01:49:29PM +0800, Tai-hwa Liang wrote:
> It turns out that certain hardware sometime generates unexpected movement
> during normal operation. This patch tries to filter out these erratic
> movements which will cause unexpected cursor jumping to the top-left corner.
> 
> This patch also tries to fix jumpy(back and forth) scrolling in X11 by
> accumulating both fingers' coordinates before reporting to the input-mt layer.
> 
> Bugzilla:	https://bugzilla.kernel.org/show_bug.cgi?id=43197
> Reported-and-tested-by:	Aleksey Spiridonov <leks13@leks13.ru>
> Tested-by:	Eddie Dunn <eddie.dunn@gmail.com>
> Tested-by:	Olivier Goffart <olivier@woboq.com>
> ---
>  drivers/input/mouse/sentelic.c |  114 ++++++++++++++++++++++++++--------------
>  drivers/input/mouse/sentelic.h |   35 ++++++++++++
>  2 files changed, 110 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c
> index 3f5649f..995b395 100644
> --- a/drivers/input/mouse/sentelic.c
> +++ b/drivers/input/mouse/sentelic.c
> @@ -707,7 +707,7 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse)
>  	struct fsp_data *ad = psmouse->private;
>  	unsigned char *packet = psmouse->packet;
>  	unsigned char button_status = 0, lscroll = 0, rscroll = 0;
> -	unsigned short abs_x, abs_y, fgrs = 0;
> +	unsigned short abs_x, abs_y, fgrs;
>  	int rel_x, rel_y;
>  
>  	if (psmouse->pktcnt < 4)
> @@ -721,64 +721,100 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse)
>  
>  	switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) {
>  	case FSP_PKT_TYPE_ABS:
> +		if ((packet[0] == 0x48 || packet[0] == 0x49) &&
> +		    packet[1] == 0 && packet[2] == 0) {
> +			/*
> +			 * filtering out erratic movement which will cause
> +			 * unexpected cursor jumping to the top-left corner
> +			 */
> +			packet[3] &= 0xf0;
> +		}

I am not sure if I understand this patch. According to the documentation
the above values for the packet[0] have the 'valid' bit 0 which means
that the touch data should be completely ignored instead of massaging
data like you seem to be doing.

Overall I wonder if you want to increase the size of the buffer to hold
both packets (for both fingers) and analyze both of them together...

It also appears that the patch does too many things at one and should be
split into several addressing individual issues.

Thanks.

-- 
Dmitry

  parent reply	other threads:[~2012-07-25  7:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06  5:49 [PATCH] Input: sentelic - filtering out erratic movement Tai-hwa Liang
2012-07-08  0:30 ` Tai-hwa Liang
2012-07-25  7:08 ` Dmitry Torokhov [this message]
2012-07-25 10:22   ` Tai-hwa Liang
  -- strict thread matches above, loose matches on Subject: below --
2012-06-02 14:23 Tai-hwa Liang

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=20120725070837.GA15997@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=avatar@sentelic.com \
    --cc=linux-input@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).