lkml.org 
[lkml]   [2012]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 09/19] Input: MT - Handle frame synchronization in core
> > Collect common frame synchronization tasks in a new function,
> > input_mt_sync_frame(). Depending on the flags set, it drops
> > unseen contacts and performs pointer emulation.
>
> I was really wondering why you needed to put in input-mt something
> that appeared only in hid-multitouch.... until I noted that you are
> going to use it for bcm5974.

True, you were only copied in on the patch specific to
hid-multitouch. The core changes will naturally be used for some other
drivers as well.

> Maybe you should add a comment on it (otherwise, it seams like you're
> just adding unused code). Maybe this would also help people
> understanding the *frame thing.

More comments on those plans, agreed. The "frame thing" is really only
an input core change; it can most likely be better explained as well,
but it really should not matter to drivers.

> > +void input_mt_sync_frame(struct input_dev *dev)
> > +{
> > + struct input_mt *mt = dev->mt;
> > + struct input_mt_slot *s;
> > +
> > + if (!mt)
> > + return;
> > +
> > + if (mt->flags & INPUT_MT_DROP_UNUSED) {
> > + for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
> > + if (s->frame == mt->frame)
> > + continue;
> > + input_mt_slot(dev, s - mt->slots);
> > + input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1);
>
> Shouldn't we rely on input_mt_report_slot_state instead of doing it by hand?

No, input_mt_report_slot_state() is a driver api function with side
effects which are not desired here.

> > + }
> > + }
> > +
> > + if (mt->flags & INPUT_MT_POINTER)
> > + input_mt_report_pointer_emulation(dev, true);
> > +
> > + if (mt->flags & INPUT_MT_DIRECT)
> > + input_mt_report_pointer_emulation(dev, false);
>
> The function input_mt_report_pointer_emulation could be called twice
> if the driver has both INPUT_MT_POINTER and INPUT_MT_DIRECT flags. Are
> they mutual exclusive?

You are right, and they are not. Will fix.

Thanks,
Henrik


\
 
 \ /
  Last update: 2012-08-21 02:41    [W:0.327 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site