[Bug 225343] multimedia/v4l_compat: Incorrect EVIOCGMTSLOTS ioctl which breaks libevdev

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jan 20 18:59:25 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225343

            Bug ID: 225343
           Summary: multimedia/v4l_compat: Incorrect EVIOCGMTSLOTS ioctl
                    which breaks libevdev
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: multimedia at FreeBSD.org
          Reporter: dumbbell at FreeBSD.org
             Flags: maintainer-feedback?(multimedia at FreeBSD.org)
          Assignee: multimedia at FreeBSD.org

The `EVIOCGMTSLOTS` ioctl is used to query a touchpad's multitouch state.
libevdev calls it to initialise its internal state.

On Linux, this ioctl is marked as "read". However, this is incorrect on FreeBSD
because the ioctl takes the multitouch attribute to query as argument.
Therefore, the ioctl must be marked as "read+write". Otherwise, the attribute
doesn't make it to the evdev kernel driver and ioctl(2) returns EINVAL.

The visible consequence of this problem is libinput: when you use it as your
input DDX in X.Org (the same happens with Wayland probably), some touch events
early in a session are dropped. You have to release and start another touch
move do what you wanted in the first place (move the cursor, scroll, ...).

The reason is that the multitouch state in libevdev has all fields set to zero
at first (because the ioctl(2) failed). And when it receives a first touch
event which indicate a tracking ID for 0, libevdev thinks there is a bug
because the tracking ID is already set to 0, and decides to drop the entire
touch action. Here is the message from libevdev:

    BUG: Device "..." received a double tracking ID 0 in slot 0.

When the finger is released, the kernel sends a tracking ID of -1 which fixes
libevdev internal state. Thus, the next touch action does the right thing.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-multimedia mailing list