From: Chase Douglas <chase.douglas@canonical.com>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Henrik Rydberg <rydberg@euromail.se>,
dmitry.torokhov@gmail.com, rubini@cvml.unipv.it,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
derek.foreman@collabora.co.uk, daniel.stone@collabora.co.uk,
olofj@chromium.org
Subject: Re: [PATCH 09/12] Input: synaptics - add image sensor support
Date: Wed, 06 Jul 2011 10:08:00 -0700 [thread overview]
Message-ID: <4E149670.3040807@canonical.com> (raw)
In-Reply-To: <CAGS+omDzg-xADYxKQmWy1KRhJ=n9pn9XR_HMc01xqCSDSLa5UA@mail.gmail.com>
On 07/06/2011 09:41 AM, Daniel Kurtz wrote:
> On Wed, Jul 6, 2011 at 3:27 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
>>> ...
>>> This implementation addresses the following issues:
>>>
>>> (1) Improves handling of the 2-finger case. Image sensors due allow
>>> true MT-B for two finger case. This, for example, allows detecting
>>> whether the click in a click+drag is happening in bottom right or
>>> bottom left quadrant of the pad.
>>
>> In principle, this could be done within the semi-mt realm by adding a
>> binary value to the protocol, distinguishing the diagonals of the
>> bounding box. It would be ugly too, but at least it would be
>> compatible with the current semi-mt effort in userspace.
>
> (A) I think the "semi-mt" protocol works like this:
> (1) When two or more fingers are on the pad, report two MT-B slots, where:
> (a) slot[0] contains (x_min, y_min) of the two fingers
> (b) slot[1] contains (x_max, y_max) of the two fingers
> (c) Total number of fingers on pad is indicated by EV_KEY/BTN_TOOL_* is set.
> (2) If one of the two fingers is removed, then the first slot is
> used to report
> the remaining finger, whichever it is, without changing the
> slot's tracking_id.
> (3) Advertise this behavior with the SEMI_MT device property
>
> (B) This is what the proposed T5R2 driver does:
> (1) When N fingers are on the pad, report N MT-B slots, where:
> (a) The lowest indexed active slot (tracking_id != -1) contains
> valid finger position data.
> (b) The highest indexed active slot (tracking_id != -1) contains
> valid finger position data.
> (c) Any active slots (tracking_id != -1) between these does not
> contain valid finger position data, these 'hidden' slots are just
> active to indicate that there are that many fingers on the pad.
> (d) Total number of fingers on the pad is always the number of active slots.
> (2) When fingers are removed from the pad:
> (a) keep reporting the fingers that are left in the same slots,
> with the same tracking_ids, if possible.
> (b) If the identities of the fingers that remain is ambiguous,
> invalidate all slots,then re-assign the fingers that remain to new
> slots, with new tracking ids.
> (3) Advertise this behavior with the T5R2 device property
>
> (C) A third, compromise implementation might be to do something like this:
> (1) When >=2 fingers are on the pad, report 2 MT-B slots, where:
> (a) slot[0] reports finger 1
> (b) slot[1] reports finger 2
> (c) Total number of fingers on pad is indicated by EV_KEY/BTN_TOOL_* is set.
> (2) If 1 finger is removed, the tracking_id for its slot is invalidated;
> but, the finger that remains stays in its same slot with the
> same tracking_id.
> (3) Whenever the number of fingers changes from/to 3 or more
> fingers, both slots are always invalidated.
> New tracking_ids are assigned to both slots which contain the
> two fingers now being reported.
> (4) No special driver property is required for this, not even "semi-mt".
> It should be as pure MT-B as we can get (plus BTN_TOOL_* hack).
This approach seems better, but there's still an ambiguity. When we go
from two to three or more fingers we get lossy. We can't tell what
touches cross the transition with their data intact.
I'm racking my brain trying to come up with a solution that would make
sense, but I don't think there is one that works seamlessly. I think we
should do what you've written above with two changes:
* Use a new property (T5R2?) to fully denote how screwed up this class
of devices is.
* Don't roll the tracking_id on any number of touch transitions. We're
already telling userspace that the number of touches is changing, so the
tracking_id change is superfluous. The tracking_id of a slot should only
change when we know that the touch is beginning or ending.
No matter what we do, userspace will have to rely on complex heuristics
for this device, which makes me wonder if these devices will really ever
be handled properly...
> IMHO, (C) is an improvement over (A) for two major reasons:
> (1) tracking the individual touches allows distinguishing a clicking
> finger in bottom right versus bottom left, for example.
> (2) It makes it possible to track the touch that remains when one of
> the two touches is released.
> The touch that remains will stay in the same slot, with the same
> tracking id.
> The tracking id of the touch that is removed will be set to -1.
> => This eliminates unnecessary gaps in the event stream,
> without introducing position jumps.
> This behavior occurs often when switching between 1-finger
> motion and 2f-scroll, or when performing 2f-click+drag gestures.
>
> Note: Tracking which fingers are left on the pad gets much more
> complicated with 3, 4, or 5 fingers.
> This is addressed more fully by the T5R2 solution, but (C), while
> slightly less optimal, should at least not do the wrong thing.
>
> Sorry, I find it a bit difficult to explain this clearly in writing.
> I guess I'll just have to submit a new patchset that shows what I mean.
You're not the first to be tied up trying to document Synaptics behavior :).
Thanks!
-- Chase
next prev parent reply other threads:[~2011-07-06 17:08 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 5:07 [PATCH 00/12] Synaptics image sensor support djkurtz
2011-06-29 5:07 ` [PATCH 01/12] Input: synaptics - cleanup 0x0c query documentation djkurtz
2011-07-05 17:33 ` Chase Douglas
2011-07-06 13:50 ` Daniel Kurtz
2011-07-07 6:30 ` Dmitry Torokhov
2011-06-29 5:07 ` [PATCH 02/12] Input: synaptics - do not invert y if 0 djkurtz
2011-07-04 21:08 ` Henrik Rydberg
2011-07-05 4:29 ` Daniel Kurtz
2011-07-05 18:07 ` Henrik Rydberg
2011-07-05 18:39 ` Chris Bagwell
2011-07-05 23:02 ` Daniel Kurtz
2011-07-05 17:42 ` Chase Douglas
2011-07-05 22:50 ` Daniel Kurtz
2011-07-05 23:06 ` Chase Douglas
2011-07-05 23:15 ` Daniel Kurtz
2011-07-05 23:25 ` Dmitry Torokhov
2011-06-29 5:07 ` [PATCH 03/12] Input: synaptics - fix minimum reported ABS_TOOL_WIDTH djkurtz
2011-06-29 13:28 ` Chris Bagwell
2011-06-29 16:48 ` Daniel Kurtz
2011-06-29 19:46 ` Chris Bagwell
2011-07-04 21:14 ` Henrik Rydberg
2011-07-09 6:24 ` Jeffrey Brown
2011-06-29 5:07 ` [PATCH 04/12] Input: synaptics - set resolution for MT_POSITION_X/Y axes djkurtz
2011-07-05 17:44 ` Chase Douglas
2011-07-07 6:23 ` Dmitry Torokhov
2011-06-29 5:07 ` [PATCH 05/12] Input: synaptics - process button bits in AGM packets djkurtz
2011-07-04 21:24 ` Henrik Rydberg
2011-07-05 4:38 ` Daniel Kurtz
2011-07-05 18:18 ` Henrik Rydberg
2011-07-05 18:19 ` Chase Douglas
2011-07-05 17:47 ` Chase Douglas
2011-07-07 6:24 ` Dmitry Torokhov
2011-06-29 5:07 ` [PATCH 06/12] Input: synaptics - fuzz position if touchpad reports reduced filtering djkurtz
2011-07-05 17:49 ` Chase Douglas
2011-07-07 6:25 ` Dmitry Torokhov
2011-06-29 5:07 ` [PATCH 07/12] Input: synaptics - rename synaptics_data.mt to agm djkurtz
2011-07-04 21:26 ` Henrik Rydberg
2011-07-05 4:39 ` Daniel Kurtz
2011-07-05 18:20 ` Henrik Rydberg
2011-07-05 17:53 ` Chase Douglas
2011-06-29 5:07 ` [PATCH 08/12] Input: synaptics - rename set_slot to be more descriptive djkurtz
2011-07-05 17:54 ` Chase Douglas
2011-07-07 6:27 ` Dmitry Torokhov
2011-06-29 5:07 ` [PATCH 09/12] Input: synaptics - add image sensor support djkurtz
2011-07-04 21:42 ` Henrik Rydberg
2011-07-05 5:08 ` Daniel Kurtz
2011-07-05 19:27 ` Henrik Rydberg
2011-07-06 16:41 ` Daniel Kurtz
2011-07-06 17:08 ` Chase Douglas [this message]
2011-07-06 17:45 ` Dmitry Torokhov
2011-07-06 18:47 ` Henrik Rydberg
2011-07-06 18:58 ` Dmitry Torokhov
2011-07-06 19:31 ` Henrik Rydberg
2011-07-06 20:00 ` Dmitry Torokhov
2011-07-06 20:20 ` Henrik Rydberg
2011-07-06 21:22 ` Chase Douglas
2011-07-06 21:36 ` Dmitry Torokhov
2011-07-06 22:16 ` Chase Douglas
2011-07-06 22:35 ` Henrik Rydberg
2011-07-06 23:30 ` Chase Douglas
2011-06-29 5:07 ` [PATCH 10/12] Input: synaptics - decode AGM packet types djkurtz
2011-06-29 10:02 ` Chase Douglas
2011-06-29 10:07 ` Daniel Stone
2011-06-29 10:32 ` Chase Douglas
2011-06-29 11:26 ` Daniel Kurtz
2011-06-29 11:04 ` Daniel Kurtz
2011-07-05 18:17 ` Chase Douglas
2011-07-05 18:55 ` Chris Bagwell
2011-07-06 16:53 ` Daniel Kurtz
2011-06-29 5:07 ` [PATCH 11/12] Input: synaptics - process finger (<=3) transitions djkurtz
2011-06-29 5:07 ` [PATCH 12/12] Input: synaptics - process finger (<=5) transitions djkurtz
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=4E149670.3040807@canonical.com \
--to=chase.douglas@canonical.com \
--cc=daniel.stone@collabora.co.uk \
--cc=derek.foreman@collabora.co.uk \
--cc=djkurtz@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olofj@chromium.org \
--cc=rubini@cvml.unipv.it \
--cc=rydberg@euromail.se \
/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