[PATCH v4 00/10] Xephyr input hotplugging support and other additions for single-GPU multi-seat

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Mon Jun 22 09:23:20 PDT 2015


PLEASE NOTE: Xephyr is NOT my preferred approach for single-GPU
multi-seat configuration (mainly due to its limited support for handling
input devices --- no touchpads, no touchscreens, no joysticks),
but it's the easiest one to implement right now. The best approach
by far (in Linux specifically) would require KMS device node splitting,
as proposed in
https://dvdhrm.wordpress.com/2013/09/01/splitting-drm-and-kms-device-nodes/.
Until such a solution is completely implemented and supported by
video drivers, the most common approach for single-GPU multi-seat
configuration is based on nested X servers, i.e. a bare Xorg server
spanning all desired video outputs, on top of which we launch a nested
X server for each output. My preferred approach in this case would be
Xorg itself with xf86-video-nested driver, but the latter is currently
unmaintained, and I have no knowledge about video drivers and no spare time
to maintain it. The other approach (historically the most used one)
is Xephyr: it's currently actively maintained, it has reasonable graphics
performance (compared to xf86-video-nested) and it has a minimal support for
input devices (keyboard and mouse only), but it still have some gaps
for a more comfortable multi-seat configuration. This patch series
intend to fill them.

This is the v4 of patch series which provides some missing parts
for full single-GPU multi-seat support in Xephyr. The main difference
to v3 is the dropping of explicit -input-hotplug command-line option:
sice input hot-plugging support in Xephyr is very unlikely to
be used outside multi-seat context, it's now automatically enabled
if, and only if, -seat option is passed.

Example of Xephyr-based seat configuration in LightDM 1.12 or newer based
on this patch series (provided that a bare X server on display number :90,
with two outputs named LVDS and VGA, is already running):

[Seat:seat-LVDS]
xserver-command=Xephyr -dpi 96 -sw-cursor -xkbrules evdev -xkblayout br -xkbmodel abnt2 -host-display :90 -output LVDS

[Seat:seat-VGA]
xserver-command=Xephyr -dpi 96 -sw-cursor -xkbrules evdev -xkblayout br -xkbmodel abnt2 -host-display :90 -output VGA

** HISTORY **
v3 includes two patches: one that introduces a new flag to better
distinguish between real keyboards and other key input devices (so that
kdrive can grab keyboards only), and another one that prevents kdrive
evdev driver from deliberately renaming keyboard and pointer devices
if they are already named (e.g. from udev), with potential memory leaks.

v2 fixes some problems found in v1, like double-free errors for some
InputOption objects, and memory corruptions when a USB keyboard or mouse is
unplugged and replugged several times, due to the fact that their FDs may not be
successfully unregistered when they are unplugged. It also brings new patches
for improving NewInputDeviceRequest() implementation in hw/kdrive/src/kinput.c
(making use of KdParseKbdOptions() and KdParsePointerOptions() as requested),
and some other minor changes.

Some patches provide new command-line options to make it
easier to launch Xephyr directly from display manager, rather
than from within a user session.

One of them fixes an issue where Xephyr keyboards' LEDs are not toggled
when NumLock, CapsLock, and ScrollLock are pressed.

The most significant one introduces input hotplugging support for
keyboards and pointers with both hal and udev backends.

Laércio de Sousa (9):
  ephyr: allow passing explictly host X server display number and/or
    authorization file path
  kdrive: fix up NewInputDeviceRequest() implementation
  kdrive: set "evdev" driver for input devices automatically, if
    available.
  kdrive: introduce input hot-plugging support for udev and hal backends
    (#33140)
  kdrive: add options to set default XKB properties
  ephyr: ignore "-sharevts" and "-layout seatXXX" command-line options
  ephyr: move host_has_extension() implementation to hostx.c
  config/udev: better distinguish between real keyboards and other key
    input devices
  kdrive: don't let evdev driver overwrite existing device names

Mikhail Krivtsov (1):
  kdrive: update evdev keyboard LEDs (#22302)

 config/hal.c                   |   2 +-
 config/udev.c                  |   4 +
 config/wscons.c                |   2 +-
 hw/kdrive/ephyr/ephyr.c        |  12 +-
 hw/kdrive/ephyr/ephyrdriext.c  |   4 +-
 hw/kdrive/ephyr/ephyrglxext.c  |   2 +-
 hw/kdrive/ephyr/ephyrinit.c    |  26 ++++
 hw/kdrive/ephyr/hostx.c        |  16 +-
 hw/kdrive/ephyr/hostx.h        |   2 +-
 hw/kdrive/linux/evdev.c        |  17 ++-
 hw/kdrive/src/Makefile.am      |   2 +
 hw/kdrive/src/kdrive.c         |  74 +++++++++
 hw/kdrive/src/kinfo.c          |   4 +
 hw/kdrive/src/kinput.c         | 335 ++++++++++++++++++++++++++++++++---------
 hw/xfree86/common/xf86Xinput.c |   2 +-
 include/input.h                |  13 +-
 16 files changed, 415 insertions(+), 102 deletions(-)

-- 
2.3.6



More information about the xorg-devel mailing list