With the previous approach, every libevdev_next_event() invocation triggered a read() on the device fd. This is not efficient, the kernel provides whole event frames at a time so we're guaranteed to have more events waiting unless the current event is a SYN_REPORT. Assuming a fast-enough client and e.g. a touchpad device with multiple axes per frame, we'd thus trigger several unnecessary read() calls per event frame. Drop this behavior, instead only trigger the read when our internal queue is empty and we need more events. Fallout: - we don't have any warning about a too-slow sync, i.e. if a SYN_DROPPED arrives while we're syncing, we don't get a warning in the log anymore. the test for this was removed. - the tests that required the specific behavior were rewritten accordingly - a revoke on a kernel device doesn't return ENODEV until already-received events have been processed The above shouldn't be an issue for existing real-world clients. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> |
||
|---|---|---|
| doc | ||
| include/linux | ||
| libevdev | ||
| m4 | ||
| test | ||
| tools | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| autogen.sh | ||
| configure.ac | ||
| COPYING | ||
| libevdev.pc.in | ||
| Makefile.am | ||
| README.md | ||
libevdev - wrapper library for evdev input devices
libevdev is a wrapper library for evdev devices. it moves the common tasks when dealing with evdev devices into a library and provides a library interface to the callers, thus avoiding erroneous ioctls, etc.
git@gitlab.freedesktop.org:libevdev/libevdev.git https://gitlab.freedesktop.org/libevdev/libevdev.git
The eventual goal is that libevdev wraps all ioctls available to evdev devices, thus making direct access unnecessary.
Go here for the API documentation: http://www.freedesktop.org/software/libevdev/doc/latest/
File bugs in the freedesktop.org GitLab instance: https://gitlab.freedesktop.org/libevdev/libevdev/issues/
Patches, questions and general comments should be submitted to the input-tools@lists.freedesktop.org mailing list: http://lists.freedesktop.org/mailman/listinfo/input-tools