libweston: implement touch calibration protocol

Graphics / Wayland / Weston - Louis-Francis Ratté-Boulianne [collabora.com] - 30 May 2018 11:46 EDT

This implements a new global interface weston_touch_calibration, which allows one client at a time to perform touchscreen calibration. This also implements the calibrator window management.

A client asks to calibrate a specific physical touch device (not a wl_seat which may have several physical touch devices aggregated). Libweston grabs all touch devices and prevents normal touch event handling during the calibation sequence.

API is added to enable this new global interface, but it not yet called by anything. Since the implementation allows clients to grab touch devices arbitrarily, it is not enabled by default. The compositor should take measures to prevent unexpected access to the interface.

A client may upload a new calibration to the compositor. There is a
vfunc to allow the compositor to reject/accept it and save it to persistent storage. The persistent storage could be a udev rule setting LIBINPUT_CALIBRATION_MATRIX, so that all display server would load the new calibration automatically.

Co-developed by Louis-Francis and Pekka.

v2:- use struct weston_point2d_device_normalized- use syspath instead of devpath- wrong_touch was renamed to invalid_touch- rename weston_touch_calibrator::cancelled to calibration_cancelled- send invalid_touch on out-of-bounds touch-down- cancel touch sequence and send invalid_touch on motion going out-of-bounds- rename calcoord_from_double() to wire_uint_from_double()- send bad_coordinates error in touch_calibrator_convert()- conversion results in 0,0 if cancelled

83630983 libweston: implement touch calibration protocol
Makefile.am | 1 +
libweston/compositor.h | 41 ++-
libweston/input.c | 4 +
libweston/touch-calibration.c | 716 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 760 insertions(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share