Make sure that uinput state field reflects actual state by checking
evdev_register result for errors
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Differential Revision: https://reviews.freebsd.org/D9320
There was report of stable/11 build failure on older versions of
FreeBSD. The problem was a reference to static variable in inline
function. Although fairly recent versions of clang can cope with this
situation just fine there is no strict requirement to make functions
in question inline, they're not in any time-critical codepath. So to
keep HEAD and 11-STABLE buildable on older FreeBSDs some of the util
functions were converted from inline to normal.
Reported by: hselasky
MFC after: 3 days
For horizontal (T-axis) wheel reporting which is not supported by
sysmouse protocol kern.evdev.sysmouse_t_axis sysctl is introduced.
It can take following values:
0 - no T-axis events (default)
1 - T-axis events are originated in ums(4) driver.
2 - T-axis events are originated in psm(4) driver.
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8597
Add wrappers around generic evdev_push_event for specific event types:
EV_KEY/EV_REL/EV_ABS etc...
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Automaticaly release (send ABS_MT_TRACKING_ID = -1) MT-slots
that has not been listed in current MT protocol type B report.
Slot is counted as listed if corresponding ABS_MT_SLOT event
has been sent regardless of other MT events.
Events are sent on SYN_REPORT event.
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Add new API call: evdev_register_mtx which takes lock argument that
should be used instead of internal one for evdev locking. Useful for
cases if evdev_push_event() is always called with driver's lock taken
and reduces amount of lock aquisitions. This allows to avoid LOR
between ev_open/ev_close invocations and evdev_push_event() Such LOR
can happen when ev_open/ev_close methods acquire driver lock and
evdev_push_event() is called with this lock taken.
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
- Convert "options EVDEV" to "device evdev" and "device uinput", add
modules for both new devices. They are isolated subsystems and do not
require any compile-time changes to general kernel subsytems
- For hybrid drivers that have evdev as an optional way to deliver input
events add option EVDEV_SUPPORT. Update all existing hybrid drivers
to use it instead of EVDEV
- Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
is enough
- Add evdev module dependency to uinput
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Prepare for making evdev a module. "Pure" evdev device drivers (like
touchscreen) and evdev itself can be built as a modules regardless of
"options EVDEV" in kernel config. So if people does not require evdev
functionality in hybrid drivers like ums and ukbd they can, for instance,
kldload evdev and utouchscreen to run FreeBSD in kiosk mode.
Add check for evdev argument of evdev_free being NULL. This is valid
value and should not cause crash. In this case evdev_free does nothing
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
evdev is a generic input event interface compatible with Linux
evdev API at ioctl level. It allows using unmodified (apart from
header name) input evdev drivers in Xorg, Wayland, Qt.
This commit has only generic kernel API. evdev support for individual
hardware drivers like ukbd, ums, atkbd, etc. will be committed later.
Project was started by Jakub Klama as part of GSoC 2014. Jakub's
evdev implementation was later used as a base, updated and finished
by Vladimir Kondratiev.
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: adrian, hans
Differential Revision: https://reviews.freebsd.org/D6998