[PATCH v5 RESEND RFC 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 Aug 24 05:44:52 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 in the moment. 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 v5 of patch series which provides some missing parts
for full single-GPU multi-seat support in Xephyr. The main difference
to v4 is that now input-hotplugging for kdrive is only built if one
of CONFIG_UDEV or CONFIG_HAL options is enabled.

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 **
v4 drops explicit option -input-hotplug. Since 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.

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      |   8 +
 hw/kdrive/src/kdrive.c         |  79 ++++++++++
 hw/kdrive/src/kinfo.c          |   4 +
 hw/kdrive/src/kinput.c         | 346 +++++++++++++++++++++++++++++++++--------
 hw/xfree86/common/xf86Xinput.c |   2 +-
 include/input.h                |  13 +-
 16 files changed, 437 insertions(+), 102 deletions(-)

-- 
2.5.0


More information about the xorg-devel mailing list