Project Description
This project aims to implement evdev protocol support in FreeBSD kernel, thus allowing to use xorg unmodified evdev input driver (xf86-input-evdev) and adding generic support for touchscreen devices.
For now, there's a couple of incompatible touchscreen drivers in FreeBSD - for example, uep(4), which has it's own character device node and custom xorg driver talking with it. Having evdev support in kernel will allow to use one, already existing driver on xorg side: xf86-input-evdev.
The plan is to also modify uhid(4) driver to report events using evdev interface. That will allow to use FreeBSD on QEMU with -usbdevice tablet switch and will therefore fix issue with misplaced cursor in FreeBSD running on QEMU and VNC.
Why evdev?
- evdev protocol is pretty flexible and allows to easily represent multi-touch events from touchscreens, endless mouse buttons and so on.
- it's suprisingly simple and has simple implementation.
- covers wide range of input devices (including even laptop lids)
Assumptions
- evdev device nodes will be visible at /dev/input/
- All existing mouse and keyboard drivers will remain the same and will retain existing interfaces, will be exposed using evdev interface also.
- Touchscreens will have evdev interface only
- It will be possible to have xorg with xf86-input-evdev as sole input driver
- It will be possible to inject events from software by writing to evdev device node
- /dev/sysmouse will also have its evdev node
Features present in Linux, but out of scope of this project
- userspace input devices (uinput), created and controlled by userspace processes
- confirmed multitouch support (due to lack of test hardware, but easy to implement as separate project)
Project timeline
- Create evdev protocol headers and interface specification - week 0
Design and implement generic evdev kernel interface for input devices. It should be simple as possible and will be probably somewhat inspired by the Linux interface. - weeks 1-2
- Write evdev character device interface, which includes:
- EVIOC* ioctls
- event processing from driver to userspace
- event processing from userspace to driver (injecting events by software)
- reporting of buffer overruns using SYN_DROPPED event - weeks 3-4
- Write wrapper for keyboards to report events to evdev layer - week 5
- Modify existing mice drivers (psm, mse, ums) to report events to evdev layer - week 6
- Create unit tests using python-evdev - week 7
- Compile and run xf86-input-evdev under FreeBSD - week 8
- Rewrite uep(4) driver for evdev support - week 9
- Rewrite uhid(4) driver - weeks 10-11
- Final cleanups - week 12
Deliverables
M0 - kernel interface established
M1 - evdev character devices in place
M2 - first evdev events from mouse read using python-evdev
M3 - keyboards and mice reporting events via evdev
M4 - xorg running with xf86-input-evdev
M5 - uep(4) working with evdev and xorg
M6 - uhid(4) device working with evdev and xorg
M7 - unit tests passed
Code
Source repository: http://svn.freebsd.org/base/user/jceel/soc2014_evdev