From: "Henrik Rydberg" <rydberg@bitmath.org>
To: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Cc: Stephane Chatty <chatty@enac.fr>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Jiri Kosina <jkosina@suse.cz>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC v3 3/5] hid-multitouch: support for PixCir-based panels
Date: Tue, 11 Jan 2011 14:00:55 +0100 [thread overview]
Message-ID: <20110111130055.GB1961@polaris.bitmath.org> (raw)
In-Reply-To: <AANLkTin8tHO5x2SBugSaEQ6mJ-7upS2YX9OANK1phmdM@mail.gmail.com>
> >> +static int mt_compute_slot(struct mt_device *td)
> >> +{
> >> + struct mt_class *cls = td->mtclass;
> >> +
> >> + if (cls->quirks & MT_QUIRK_SLOT_IS_CONTACTID)
> >> + return slot_is_contactid(td);
> >
> > No real need for a function call here...
>
> just to prepare for the other patches
I mean the line could simply read
return td->curdata.contactid;
[...]
> >> +static int mt_event(struct hid_device *hid, struct hid_field *field,
> >> + struct hid_usage *usage, __s32 value)
> >> +{
> >> + struct mt_device *td = hid_get_drvdata(hid);
> >> +
> >> + if (hid->claimed & HID_CLAIMED_INPUT) {
> >> + switch (usage->hid) {
> >> + case HID_DG_INRANGE:
> >> + break;
> >> + case HID_DG_TIPSWITCH:
> >> + td->curvalid = value;
> >
> > I do not think curvalid should depend on the touch state (which is
> > what tipswitch is). Either move to INRANGE, or simply set to true.
>
> INRANGE is not all the time used as curvalid as you are saying.
> At least for Stantum, curvalid is given by CONFIDENCE.
Yes.
> The solution of giving the value true to curvalid is not working too:
> Cypress devices can send their touches over 2 reports of 7 touches,
> even if it handles 10 touches.
Yes.
> Solution:
> 1) td->curvalid = td->num_received < td->mtclass->maxcontacts;
> (not sure it will work for all devices)
For the ones where NOT_SEEN_MEANS_UP, it ought to be true. For egalax,
it is not true.
>
> or 2) introduce MT_QUIRK_VALID_IS_INRANGE and MT_QUIRK_VALID_IS_CONFIDENCE
Yes, I believe this is a good way to go.
> or 3) let curvalid=value and disable the quirk
> MT_QUIRK_NOT_SEEN_MEANS_UP (adding a FixMe comment above)
This would mean setting curvalid = touch_state again, which according
to the discussion is precisely what we should not do. We know we need
to check whether the incoming packet represents data is whether it is
just filling up the transfer protocol size. We just need to identify,
per device, how that is done.
> >> + if (value)
> >> + td->num_expected = value - 1;
> >
> > The - 1 should be dropped here.
>
> Here is the really tricky one:
>
> if I drop -1,
>
> the test below will be:
> if (field->index == td->last_field_index
> && td->num_received >= td->num_expected)
>
> but during the init of the device, the kernel receive 1 event though
> the driver is not ready.
So the current code really needs to also check whether the driver is
ready to events. Adding a state for it would be appropriate. As it
stands, an unrelated syntatic oddity is covering up this fact.
>
> During this time, num_expected is at 0, and when we receive the
> last_field_index: segfault!
>
> To sum up, no, we can't.
Yes we can. :-)
> >> + if (field->index == td->last_field_index
> >> + && td->num_received > td->num_expected)
> >
> > A ">=" here.
still applies then.
Thanks,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-01-11 13:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 18:42 [RFC v3 0/5] hid-multitouch: a first step towards multitouch unification Benjamin Tissoires
2011-01-07 18:42 ` [RFC v3 1/5] hid: add feature_mapping callback Benjamin Tissoires
2011-01-07 18:59 ` Henrik Rydberg
2011-01-07 19:09 ` Benjamin Tissoires
2011-01-07 18:42 ` [RFC v3 2/5] hid: set HID_MAX_FIELD at 128 Benjamin Tissoires
2011-01-07 18:42 ` [RFC v3 3/5] hid-multitouch: support for PixCir-based panels Benjamin Tissoires
2011-01-07 19:49 ` Henrik Rydberg
2011-01-10 19:10 ` Benjamin Tissoires
2011-01-11 13:00 ` Henrik Rydberg [this message]
2011-01-11 13:53 ` Benjamin Tissoires
2011-01-11 15:10 ` Benjamin Tissoires
2011-01-07 18:42 ` [RFC v3 4/5] hid-multitouch: added support for Cypress TrueTouch panels Benjamin Tissoires
2011-01-07 20:00 ` Henrik Rydberg
2011-01-10 19:13 ` Benjamin Tissoires
2011-01-07 18:42 ` [RFC v3 5/5] hid-mulitouch: added support for the 'Sensing Win7-TwoFinger' Benjamin Tissoires
2011-01-07 20:03 ` Henrik Rydberg
2011-01-07 19:12 ` [RFC v3 0/5] hid-multitouch: a first step towards multitouch unification Benjamin Tissoires
2011-01-07 20:08 ` Henrik Rydberg
2011-01-07 21:06 ` Benjamin Tissoires
2011-01-07 22:58 ` Jiri Kosina
2011-01-07 23:00 ` Jiri Kosina
2011-01-08 21:25 ` Jiri Kosina
2011-01-10 18:32 ` Jiri Kosina
2011-01-10 19:24 ` Benjamin Tissoires
2011-01-11 10:37 ` Jiri Kosina
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=20110111130055.GB1961@polaris.bitmath.org \
--to=rydberg@bitmath.org \
--cc=benjamin.tissoires@enac.fr \
--cc=chatty@enac.fr \
--cc=dmitry.torokhov@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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).