xorg/driver/xf86-input-fpit - [PATCH] Don't call xf86IsCorePointer.

pcpa at mandriva.com.br pcpa at mandriva.com.br
Sun Feb 3 19:00:50 PST 2008


Quoting Peter Hutterer <mailinglists at who-t.net>:

> Paulo Cesar Pereira de Andrade wrote:
> >
> >
> >>From f4d243c7a46c019b6b34f80b33acbee61a30d54d Mon Sep 17 00:00:00 2001
> > From: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
> > Date: Wed, 30 Jan 2008 17:10:12 -0200
> > Subject: [PATCH] Don't call xf86IsCorePointer.
> >
> > Only call that function if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0.
> >
> > This patch is based on the xf86-input-acecad commit
> > 253ea9de2321bccede3f0d74ee6a6f6b403e80ae that addresses the same problem.
> > ---
> >  src/xf86Fpit.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c
> > index 531b0bd..cc30d42 100644
> > --- a/src/xf86Fpit.c
> > +++ b/src/xf86Fpit.c
> > @@ -319,7 +319,11 @@ static void xf86FpitReadInput(LocalDevicePtr local)
> >  		prox = (priv->fpitData[loop] & PROXIMITY_BIT) ? 0 : 1;
> >  		buttons = (priv->fpitData[loop] & BUTTON_BITS);
> >  		device = local->dev;
> > +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
> >  		is_core_pointer = xf86IsCorePointer(device);
> > +#else
> > +		is_core_pointer = 1;
> > +#endif
> >
> >  		xf86FpitConvert(local, 0, 2, x, y, 0, 0, 0, 0, &conv_x, &conv_y);
> >  		xf86XInputSetScreen(local, priv->screen_no, conv_x, conv_y);
>
> this is wrong. is_core_pointer actually needs to be set to 0 to make the
> driver work.
>
> better solution would be to initialise is_core_pointer to 0 by default
> and then call xf86IsCorePointer if the ABI is good.

  Thanks for the review. When I made the patch I searched for other
modules that had a similar problem, and used the same logic as in
the acecad driver, that has an almost identical code, but that patch
initializes to 1, and then checks the abi version before calling
xf86IsCorePointer().

  In the case of the acecad driver, I also believe it could be
changed to not call dlopen, and instead be linked agains't libsysfs.

  I don't know exactly the way the new input code works, so I
don't think I deserve to get credit for this patch, but if you
prefer I can write a new one initializing is_core_pointer to 0,
before the #if :-)

> Cheers,
>    Peter

Paulo






More information about the xorg mailing list