Re: [RFC] Multi-Touch (MT) support - arbitration or not

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 11, 2010 at 1:38 PM, Henrik Rydberg <rydberg@xxxxxxxxxxx> wrote:
>
>> Are we going to do the tocuh and pen aribtration in input-mt.c? I need
>> to understand this to make my patches.
>
> If the pen is implemented as just another contact, it will also be treated as
> such, and arbitration becomes the same thing as single-pointer emulation.

New questions occured when I think about input-mt.c. How are we going
to pass MT_TOOL types and resolution to the userland?

We need to pass MT_TOOL types to the userland since there would be
different tools in the same slot array. Something like:
input_report_key(input, MT_TOOL_PEN, prox); is needed.

To do so, we need to enable them by a call to __set_bit(MT_TOOL_....
first. But, __set_bit wasn't meant for MT_TOOL_ since 0
(MT_TOOL_FINGER) and 1 (MT_TOOL_PEN) are used for KEY_RESERVED and
KEY_ESC.

One way to make this work is to increase  MT_TOOL_FINGER from 0 to
something like 0x2ff (we need to increase KEY_MAX as well). Luckily
MT_TOOL_ is not in any of the existing HID drivers.

Another solution could be to pass the tool type as ABS values since we
have ABS_MT_TOOL_TYPE defined already:

input_report_abs(dev, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER);
.........
input_set_abs_params(dev, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER, MT_TOOL_PEN ....) .

We need to add more MT tool types, such as MT_TOOL_AIRBRUSH...., for
styli. Not sure if we want to go that far or not.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux