[PATCH kdrive/ephyr v8 0/4] Xephyr input hot-plugging support and other additions for single-GPU multi-seat
Laércio de Sousa
laerciosousa at sme-mogidascruzes.sp.gov.br
Fri Feb 12 16:17:58 UTC 2016
This is the v8 of patch series which provides some missing parts
for full single-GPU multi-seat support in Xephyr. This version is
mainly for fixing purposes, since most of v7 patches are already
merged. The main differences to v7 are the following:
* Some fixes and clean-ups in patch that introduces hot-plugging feature,
following discussions with Adam Jackson, Peter Hutterer,
and Emil Velikov.
- During tests, I realized that some issues regarding input
hot-plugging with evdev driver in kdrive only seems to affect
Debian/Ubuntu systems, so I've dropped some pieces of code written
to address such issues at upstream level.
* Some fixes and cahges in patch that introduces command-line options
-xkb-layout et al., following Hutterer's advices.
* The patch with a workaround to make keyboard LEDs
work properly in Xephyr was dropped for now. After discussing
with Hutterer, I've decided to search for a better solution,
which I'll submit in a second moment.
* A new patch is introduced to enable option -sw-cursor by default
if -seat is passed.
Example of systemd service unit "xorg at .service" to launch a bare
Xorg server to be used by Xephyr:
Description=Service for Xorg server at display :%i
ExecStart=/usr/bin/X :%i -seat __fake-seat__ -dpms -s 0 -nocursor
# Not needed if Xorg is to be started via
# socket-activation (see xorg at .socket below)
NOTE: in this example, __fake-seat__ is a trick to ensure
this bare Xorg server will neither touch VTs (like a
seat0 X server does) nor grab input devices (like a
non-seat0 X server does).
Example of systemd socket unit "xorg at .socket" to be used in
conjunction with service unit above (if Xorg was built with
systemd socket-activation support):
Description=Socket for Xorg server at display :%i
Example of Xephyr-based seat configuration in LightDM 1.12
and 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):
xserver-command=env DISPLAY=:90 Xephyr -xkb-rules evdev -xkb-layout br -xkb-model abnt2 -output LVDS
xserver-command=env DISPLAY=:90 Xephyr -xkb-rules evdev -xkb-layout br -xkb-model abnt2 -output VGA
** IDEAS FOR FURTHER STEPS **
* Write a new input driver for kdrive, based on libinput
(or find a way to share the same input drivers
between kdrive and Xorg itself).
* Bring InputClass matching rules support (or something similar)
to kdrive, so we don't need to rely on e.g. udev rules to
retrieve XKB preperties.
* Eventually search for a better integration with
systemd-logind, so that Xephyr can be started
in multi-seat mode without root privileges
(may require root-less Xorg support in display
** HISTORY **
In v7, ephyr input driver for kdrive won't be loaded
in multi-seat mode, i.e. if -seat option is passed to Xephyr, so that
it'll handle only its seat's input hardware. In this version, we've
also dropped patch to add command-line options -host-display and
-host-auth for Xephyr (use "env DISPLAY=... XAUTHORITY=... Xephyr" instead).
v6 adds "-novtswitch" to the list of command-line
arguments ignored by Xephyr.
v5 only builds input hot-plugging for kdrive if one
of CONFIG_UDEV or CONFIG_HAL options is enabled.
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.
The most significant one introduces input hotplugging support for
keyboards and pointers with both hal and udev backends.
Laércio de Sousa (4):
kdrive: introduce input hot-plugging support for udev and hal backends
kdrive: add options to set default XKB properties
ephyr: enable option -sw-cursor by default in multi-seat mode
config/udev: better distinguish between real keyboards and other key
config/hal.c | 2 +-
config/udev.c | 4 +
config/wscons.c | 2 +-
hw/kdrive/ephyr/ephyrinit.c | 3 +
hw/kdrive/src/Makefile.am | 8 ++
hw/kdrive/src/kdrive.c | 96 ++++++++++++++++++++++
hw/kdrive/src/kinfo.c | 4 +
hw/kdrive/src/kinput.c | 182 ++++++++++++++++++++++++++++++++++-------
hw/xfree86/common/xf86Xinput.c | 2 +-
include/input.h | 13 +--
10 files changed, 279 insertions(+), 37 deletions(-)
More information about the xorg-devel