[PATCH synaptics v2 10/21] Use hardware time where possible

Daniel Stone daniel at fooishbar.org
Thu Jun 23 03:25:05 PDT 2011


Hi,

On Wed, Jun 15, 2011 at 01:42:13PM +0800, Daniel Kurtz wrote:
> On Wed, Jun 15, 2011 at 1:05 AM, Daniel Stone <daniel at fooishbar.org> wrote:
> > @@ -2460,7 +2457,7 @@ repeat_scrollbuttons(const InputInfoPtr pInfo,
> >  * occurs.
> >  */
> >  static int
> > -HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw)
> > +HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now)
> 
> Why must you pass in hw.millis as "now"?
> Why not just extract and truncate within HandleState:
> CARD32 now = (CARD32)hw->millis;
> 
> Even better, why not handle this conversation in the three places
> where it is currently required:
>   update_hw_button_state()
>   HandleTapProcessing()
>   repeat_scrollbuttons()
> 
> Or, at a very low level, like within TIME_DIFF().  This might make
> most of this patch disappear.

Quite possibly, yes.  But I'm trying to slowly evolve the driver to a
point where it's not quite so dependent on hw->millis and friends, so we
can make things like the timer code a lot more predictable.  Right now
the mixture of event timestamp and timer timestamps is more than a
little insane, and makes it difficult to say with any certainty what's
going to happen when you hit HandleState.

Baby steps towards a sensible driver, I guess.

I've fixed all the rest of your comments, thanks.

Cheers,
Daniel


More information about the xorg-devel mailing list