[PATCH 11/18] Check multi_touch module parameter and enable forcibly
Takashi Iwai
tiwai at suse.de
Tue Oct 12 23:17:46 PDT 2010
At Wed, 13 Oct 2010 13:53:10 +1000,
Peter Hutterer wrote:
>
>
> explanation please. what does this do, why do we want to enable it forcibly,
> etc?
The patch was introduced since I made the kernel driver behaving in ST
mode as default, but switched to MT via the option dynamically. This
was just for conservativeness, as the kernel driver doesn't send
ABS_{X,Y} and ABS_PRESSURE in MT mode, which makes ST-apps
non-working.
Now, I'm reconsidering that ABS_{X,Y} and ABS_PRESSURE can be sent
*in addition* to ABS_MT_*. In MT mode, both ABS_{X,Y,PRESSURE} and
ABS_MT_* are sent for the primary point.
That is, old user-space apps would take only ABS_{X,Y,PRESSURE} and
ignore ABS_MT_*. Meanwhile, MT-aware apps would take only ABS_MT_*
and ignore ABS_{X,Y,PRESSURE}. So a patch like this won't be needed
at all...
Takashi
> Cheers,
> Peter
>
> On Fri, Oct 08, 2010 at 07:22:35PM +0200, Takashi Iwai wrote:
> > Signed-off-by: Takashi Iwai <tiwai at suse.de>
> > ---
> > src/eventcomm.c | 22 ++++++++++++++++++++++
> > 1 files changed, 22 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/eventcomm.c b/src/eventcomm.c
> > index 5969448..2223bac 100644
> > --- a/src/eventcomm.c
> > +++ b/src/eventcomm.c
> > @@ -179,6 +179,27 @@ event_query_info(InputInfoPtr pInfo)
> > }
> > }
> >
> > +/* enable multi-touch feature via module parameter */
> > +#define MULTI_TOUCH_SYSFS_PARM "/sys/module/psmouse/parameters/multi_touch"
> > +static void enable_multi_touch(void)
> > +{
> > + int fd;
> > + char val = '0';
> > + fd = open(MULTI_TOUCH_SYSFS_PARM, O_RDONLY);
> > + if (fd < 0)
> > + return;
> > + read(fd, &val, 1);
> > + close(fd);
> > + if (val == '1' || val == '2')
> > + return;
> > + fd = open(MULTI_TOUCH_SYSFS_PARM, O_WRONLY);
> > + if (fd < 0)
> > + return;
> > + val = '1';
> > + write(fd, &val, 1);
> > + close(fd);
> > +}
> > +
> > static void event_query_multi_touch(LocalDevicePtr local)
> > {
> > SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
> > @@ -535,6 +556,7 @@ EventReadDevDimensions(InputInfoPtr pInfo)
> > SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
> > BOOL *need_grab = (BOOL*)priv->proto_data;
> >
> > + enable_multi_touch();
> > if (event_query_is_touchpad(pInfo->fd, (need_grab) ? *need_grab : TRUE))
> > event_query_axis_ranges(pInfo);
> > event_query_info(pInfo);
> > --
> > 1.7.3.1
> >
>
More information about the xorg-devel
mailing list