Find a file
Peter Hutterer 76662deeff Don't read events unless required
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>
2019-03-19 01:02:52 +00:00
doc doc: drop the HTML_TIMESTAMP 2016-08-29 08:00:49 +10:00
include/linux include: sync event codes with kernel 5.0 2019-03-06 10:56:55 +10:00
libevdev Don't read events unless required 2019-03-19 01:02:52 +00:00
m4 m4: fix CC_CHECK_WERROR and CC_FLAG_VISIBILITY macros 2014-06-05 15:16:06 +10:00
test Don't read events unless required 2019-03-19 01:02:52 +00:00
tools Update struct input_event 2018-04-12 15:23:22 +10:00
.gitignore Add some more files to gitignore 2015-11-10 13:07:10 +10:00
.gitlab-ci.yml GitLab CI: actually reference the default artifacts 2018-07-09 11:14:14 +10:00
autogen.sh autogen: add default patch prefix 2017-01-26 14:25:02 +10:00
configure.ac libevdev 1.6.0 2018-10-26 09:50:23 +10:00
COPYING Update COPYING file. 2013-11-15 09:30:10 +10:00
libevdev.pc.in Fix name and version in pkgconfig file 2013-07-24 07:27:17 +10:00
Makefile.am configure.ac: remove --disable-test-run 2018-06-29 11:50:38 +10:00
README.md Change all URLs to gitlab.fdo 2018-06-06 18:20:11 +10:00

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