From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Henrik Rydberg <rydberg@euromail.se>,
chase.douglas@canonical.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, olofj@chromium.org,
chris@cnpbagwell.com
Subject: Re: [PATCH 4/8 v3] Input: synaptics - add image sensor support
Date: Wed, 17 Aug 2011 10:34:44 -0700 [thread overview]
Message-ID: <20110817173444.GE4877@core.coreip.homeip.net> (raw)
In-Reply-To: <CAGS+omAR1uxS_RA=axmWzwZUgkhZEW+9W8Zk=LHPtALqA990+w@mail.gmail.com>
On Thu, Aug 18, 2011 at 12:43:39AM +0800, Daniel Kurtz wrote:
> On Thu, Aug 18, 2011 at 12:32 AM, Dmitry Torokhov <dmitry.torokhov@gmail.com
> > wrote:
>
> > On Wed, Aug 17, 2011 at 10:05:48PM +0800, Daniel Kurtz wrote:
> > > On Mon, Aug 15, 2011 at 3:17 PM, Daniel Kurtz <djkurtz@chromium.org>
> > wrote:
> > > >
> > > > Hi Henrik,
> > > >
> > > > Thanks for the great feedback.
> > > >
> > > > On Sat, Aug 13, 2011 at 5:09 AM, Henrik Rydberg <rydberg@euromail.se>
> > wrote:
> > > > > Hi Daniel,
> > > > >
> > > > > looks good, some details below.
> > > > >
> > > > > The ABS_MT_TOUCH_MAJOR is supposed to have zero intercept, to remain
> > > > > compatible with user space handling of type A devices. Also, the
> > scale
> > > > > should match the screen/pad size, such that the actual size of the
> > > > > touch area can be deduced. In addition, based on the current sensor
> > > > > technologies, ABS_MT_PRESSURE and ABS_MT_TOUCH_MAJOR are normally
> > > > > mutually exclusive.
> > > > >
> > > > > All in all, I would prefer to only report width via (the
> > single-finger
> > > > > axis) ABS_TOOL_WIDTH, and only for compatibility reasons.
> > > > >
> > > > > +
> > > > > +static void synaptics_report_slot_agm(struct input_dev *dev, int
> > slot,
> > > > > + const struct synaptics_hw_state
> > *agm)
> > > > > +{
> > > > > + input_mt_slot(dev, slot);
> > > > > + input_mt_report_slot_state(dev, MT_TOOL_FINGER, true);
> > > > > + input_report_abs(dev, ABS_MT_POSITION_X, agm->x);
> > > > > + input_report_abs(dev, ABS_MT_POSITION_Y, invert_y(agm->y));
> > > > > + input_report_abs(dev, ABS_MT_PRESSURE, agm->z);
> > > > > +}
> > > >
> > > > With ABS_MT_TOUCH_MAJOR dropped, sgm and agm seems to coincide...
> > > > ....
> > > > >
> > > > > Looks good otherwise.
> > > > >
> > > > > Thanks,
> > > > > Henrik
> > > > >
> > > >
> > > > Ahh.... ok, this makes sense. I missed this detail previously.
> > > > Basically:
> > > > * Only report synaptics "w" as ABS_TOOL_WIDTH (for backwards
> > compatibility)
> > > > * Report synaptics "z" as ABS_MT_TOUCH_MAJOR (assuming it is really
> > > > 'width of finger in surface units'), and ABS_PRESSURE (for backwards
> > > > compatibility).
> > > > * Don't use ABS_MT_PRESSURE.
> > > > * This will simplify agm/sgm reporting by making them both reoprt
> > > > the same axes.
> > >
> > > Hi Henrik,
> > >
> > > I think I was wrong in my previous comment.
> > >
> > > I agree we should drop reporting synaptics 'w' (4-15, arbitrary units)
> > > in ABS_MT_TOUCH_MAJOR.
> > > Instead, to support legacy, report 'w' in ABS_TOOL_WIDTH, and do not
> > > report ABS_MT_TOUCH_MAJOR at all.
> > >
> > > However, I believe we should still report synaptics 'z' (0-255, in
> > > arbitrary units) as ABS_MT_PRESSURE.
> > > This will, in turn, be used by input_mt_report_pointer_emulation() to
> > > determine the correct ABS_PRESSURE to report for legacy userspace
> > > uses.
> >
> > Alternatively, you can use input_mt_set_value() to save Z value to be
> > used by input_mt_report_pointer_emulation() later, but not report it as
> > part of MT packet.
> >
>
> But I want userspace to get per-contact pressure, since it is used to
> determine whether a given contact is a palm or finger, etc. The trackpad
> does not report a useful per-contact "width" that can be used to generate
> "TOUCH_MAJOR".
If the data reported is indeed pressure and it is indeed per-contact then yes,
it makes sense to report it as such. If the data reported is more like contact
size then report it as ABS_MT_TOUCH_MAJOR and use input_mt_set_value()
to "stash" it for legacy emulation.
--
Dmitry
next prev parent reply other threads:[~2011-08-17 17:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-12 17:16 [PATCH 0/8 v3] Synaptics image sensor support Daniel Kurtz
2011-08-12 17:16 ` [PATCH 1/8 v3] Input: synaptics - refactor y inversion Daniel Kurtz
2011-08-12 17:16 ` [PATCH 2/8 v3] Input: synaptics - refactor agm packet parsing Daniel Kurtz
2011-08-12 17:16 ` [PATCH 3/8 v3] Input: synaptics - refactor initialization of abs position axes Daniel Kurtz
2011-08-12 17:16 ` [PATCH 4/8 v3] Input: synaptics - add image sensor support Daniel Kurtz
2011-08-12 21:09 ` Henrik Rydberg
2011-08-15 7:17 ` Daniel Kurtz
2011-08-17 14:05 ` Daniel Kurtz
2011-08-17 16:32 ` Dmitry Torokhov
2011-08-17 16:47 ` Daniel Kurtz
[not found] ` <CAGS+omAR1uxS_RA=axmWzwZUgkhZEW+9W8Zk=LHPtALqA990+w@mail.gmail.com>
2011-08-17 17:34 ` Dmitry Torokhov [this message]
2011-08-12 17:16 ` [PATCH 5/8 v3] Input: synaptics - decode AGM packet types Daniel Kurtz
2011-08-12 17:16 ` [PATCH 6/8 v3] Input: synaptics - process finger (<=3) transitions Daniel Kurtz
2011-08-12 21:52 ` Henrik Rydberg
2011-08-15 7:46 ` Daniel Kurtz
2011-08-12 17:16 ` [PATCH 7/8 v3] Input: add BTN_TOOL_QUINTTAP for reporting 5 fingers on touchpad Daniel Kurtz
2011-08-12 17:16 ` [PATCH 8/8 v3] Input: synaptics - process finger (<=5) transitions Daniel Kurtz
2011-08-16 17:41 ` [PATCH 0/8 v3] Synaptics image sensor support Chase Douglas
2011-08-16 22:20 ` Chase Douglas
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=20110817173444.GE4877@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=chase.douglas@canonical.com \
--cc=chris@cnpbagwell.com \
--cc=djkurtz@chromium.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olofj@chromium.org \
--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;
as well as URLs for NNTP newsgroup(s).