On Thu, Dec 9, 2010 at 4:01 PM, Ping Cheng <[email protected]> wrote:
> On Thu, Dec 9, 2010 at 1:30 PM, Chris Bagwell <[email protected]> wrote:
>>> Event if we set absinfo.resolution properly in the kernel driver, we
>>> can not pass them to the user land. There is no ioctl to support it
>>> yet. I have raised this question last month. No one followed that RFC.
>>
>> Maybe I missed that part of your emails.  Resolution is returned as
>> apart of EVIOCGABS that we are querying today.  Its returning zero
>> today I guess.
>
> The EVIOCGABS ioctl does not report resolution since the corresponding
> kernel function: input_set_abs_params() does not have a room for
> resolution. My email to linux-input is attached below for your
> reference.
>
> On Sun, Nov 14, 2010 at 12:40 PM, Ping Cheng <[email protected]> wrote:
>> I have thought about the resolution issue for a while. I didn't want
>> to tocuh it since it affects all HID drivers. Resolution has been
>> added to absinfo since kernel 2.6.31. But no kernel driver has passed
>> resolution to the userland yet. We (linuxwacom project) still keep a
>> resolution table in the X driver. Passing resolution to the userland
>> from the kernel can get rid of those tables and avoid retrieving that
>> information from HID descriptor.
>>
>> One simple way to support resolution is to add "int res" to
>> input_set_abs_params(...). This means an interface change. All HID
>> drivers that call input_set_abs_params() have to be updated. We could
>> introduce a new input_set_abs_something so only those drivers that
>> want to pass the resolution switch to the new routine. Maybe you guys
>> have other suggestions?
>>
>> Ping
>>

I think this works but haven't tested it.  I can point to
xf86-input-synaptics.  Its using it in same way we want to.

http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/tree/src/eventcomm.c

    SYSCALL(rc = ioctl(pInfo->fd, EVIOCGABS(ABS_X), &abs));
    if (rc >= 0)
    {
        xf86Msg(X_PROBED, "%s: x-axis range %d - %d\n", pInfo->name,
                abs.minimum, abs.maximum);
        priv->minx = abs.minimum;
        priv->maxx = abs.maximum;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)
        priv->resx = abs.resolution;
#endif
    } else
        xf86Msg(X_ERROR, "%s: failed to query axis range (%s)\n", pInfo->name,
                strerror(errno));

I believe above code was added by same person that add resolution to
kernel's synaptics.c.  Please see that for API for how wacom can use
it.

Now, there is a thread on linux-input about ABI issues when structures
grow... so I've no idea if this logic really works.  I assume it does.

Chris

------------------------------------------------------------------------------
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to