[PATCH weston 00/25] A new touchscreen calibrator

Pekka Paalanen ppaalanen at gmail.com
Fri Mar 23 12:00:40 UTC 2018

From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Hi all,

the existing touchscreen calibrator in Weston has several problems. This
proposal intends to solve them all by introducing a new protocol
extension for touchscreen calibration and a new calibrator tool.

The benefits of the new tool, which the old tool lacks, are:

- You can unambiguously pick a physical touch device to calibrate.

- You can be sure your touch events come only from that particular
  device, and that you cannot miss touch events even if the current
  calibration is horribly wrong.

- You can be sure the calibration window (pattern) is shown on the right
  output with the right coordinates.

- You can unambiguously calibrate even multiple touchscreens that are
  all cloned (showing the same image).

- You get a libinput style calibation matrix instead of the
  WL_CALIBRATION format which depends on output resolution.

- You can load a new calibration into the compositor without playing
  tricks with udev or restarting the compositor.

There is more discussion about the topic at:

This patch series depends on the clone mode series:

There is a full branch available at:

This series contains many patches that could be landed separately, but I
have not pulled them out at this point.

A notable single patch is patch 3 which deprecates the udev property
WL_CALIBRATION. It is completely already superseded by
LIBINPUT_CALIBRATION_MATRIX property. I would hope to remove
WL_CALIBRATION support after few releases and the old calibrator tool
with it.

Patch 21 adds the touchscreen calibration protocol, patch 24 adds the
new calibrator tool, and patch 25 gives suggestions on how to let the
server permanently store a new calibration into udev rules.

As LIBINPUT_CALIBRATION_MATRIX is automatically handled by libinput,
being a description of the physical input device (like e.g. mouse dpi),
it perfectly possible to run Weston and the calibrator once to calibrate
your touchscreens, and then run whatever compositor you want.

One major thing this patch series does not address is how a Wayland
client gets authorized to use the touchscreen calibration interface. The
interface offers two privileged actions: the ability to grab all touch
input (but with provision for the server to cancel at will - not
implemented in weston so far), and the ability to upload a new
calibration for a touch device. Obviously these should not be free for
all. The method implemented here is a simple global configuration
setting to advertise or not the touchscreen calibration interface. If
advertised, it is free for all. Therefore it is not advertised by


Louis-Francis Ratté-Boulianne (7):
  input: introduce weston_touch_device
  libweston: fix weston_touch_start_grab() arg name
  input: move touchpoint counting up
  input: introduce touch event mode for calibrator
  libweston: implement touch calibration protocol
  weston: add touchscreen_calibrator option
  clients: add a new touchscreen calibrator

Pekka Paalanen (18):
  libinput: remove evdev_device::devnode
  libinput: note if calibrating without an output
  libinput: deprecate WL_CALIBRATION
  libinput: log input device to output associations
  libinput: make setting the same output a no-op
  libinput: allow evdev_device_set_output(dev, NULL)
  libinput: use head names for output matching
  libweston: require connected heads for input devices
  libinput: do not switch output associations on disable
  tests: add test_seat_release() for symmetry
  libinput: move calibration printing into do_set_calibration()
  libweston: notify_touch API to use weston_touch_device
  libweston: unexport weston_{pointer,keyboard,touch}_{create,destroy}()
  libweston: introduce notify_touch_cal() and doc
  input: do not forward unmatched touch-ups
  protocol: add weston_touch_calibration
  doc: add example calibration-helper script

 .gitignore                            |   1 +
 Makefile.am                           |  21 +-
 clients/touch-calibrator.c            | 774 ++++++++++++++++++++++++++++++++++
 clients/window.c                      |   4 +-
 clients/window.h                      |   4 +
 compositor/main.c                     |  68 +++
 doc/calibration-helper.bash           |  44 ++
 libweston/compositor-wayland.c        |  31 +-
 libweston/compositor.c                |  32 ++
 libweston/compositor.h                | 174 +++++++-
 libweston/input.c                     | 330 +++++++++++++--
 libweston/libinput-device.c           | 238 ++++++++---
 libweston/libinput-device.h           |   4 +-
 libweston/libinput-seat.c             |  88 +++-
 libweston/libinput-seat.h             |   1 +
 libweston/touch-calibration.c         | 667 +++++++++++++++++++++++++++++
 man/weston-drm.man                    |   4 +
 man/weston.ini.man                    |  36 ++
 protocol/weston-touch-calibration.xml | 320 ++++++++++++++
 tests/weston-test.c                   |  64 ++-
 20 files changed, 2771 insertions(+), 134 deletions(-)
 create mode 100644 clients/touch-calibrator.c
 create mode 100755 doc/calibration-helper.bash
 create mode 100644 libweston/touch-calibration.c
 create mode 100644 protocol/weston-touch-calibration.xml


More information about the wayland-devel mailing list