Skip to content

Clobbering of slots in MT protocol handling #1437

@mapinguari

Description

@mapinguari

Hi all,

If a device has multiple input fds each of which is conforming to the MT B protocol you end up with clobbering of MT slots.

For example, if I have two touch devices as above.

fd 1 produces:
`ABS_MT_SLOT 0

ABS_MT_TRACKING_ID 45

ABS_MT_POSITION_X 0

ABS_MT_POSITION_Y 0

SYN_REPORT
`
then some time later produces

`ABS_MT_POSITION_X 100

ABS_MT_POSITION_Y 100

SYN_REPORT`

and fd2 produces:
`ABS_MT_SLOT 0

ABS_MT_TRACKING_ID 6

ABS_MT_POSITION_X 1000

ABS_MT_POSITION_Y 1000

SYN_REPORT`

From two distinct touch events, say, one from a finger and one from a pen tool then depending on the order of the reads from the fds you can end up with any permutation of touches at (0,0), (100,100) and (1000,1000).

The input functions need to make sure they are keeping track of which fd was the last to be read from, what the last slot it was producing events for was and if it is a different fd to ensure an ABS_MT_SLOT event for the current fd's last slot is inserted into the table of events being generated. It probably also needs to maintain a mapping between an individual fd's slot number and a "globally unique" slot number so you don't end up with clobbering of slots between different input devices.

I don't think this is a driver issue, each individual driver is doing the correct thing and respecting the MT protocol, it is just when you combine multiple input sources together into a combined stream you end up with unfortunate interlacing of the event streams.

I am not sure how much appetite you have to look at this tho.

Any feedback apprecited!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions