[PATCH kdrive/ephyr v8 0/4] Xephyr input hot-plugging support and other additions for single-GPU multi-seat

Adam Jackson ajax at nwnk.net
Tue Mar 1 15:57:55 UTC 2016


On Fri, 2016-02-12 at 14:17 -0200, Laércio de Sousa wrote:
> 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:
> 
>   [Unit]
>   Description=Service for Xorg server at display :%i
> 
>   [Service]
>   ExecStart=/usr/bin/X :%i -seat __fake-seat__ -dpms -s 0 -nocursor
>   SuccessExitStatus=0 1
> 
>   # Not needed if Xorg is to be started via
>   # socket-activation (see xorg at .socket below)
>   [Install]
>   WantedBy=display-manager.service
> 
> 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):
> 
>   [Unit]
>   Description=Socket for Xorg server at display :%i
> 
>   [Socket]
>   ListenStream=/tmp/.X11-unix/X%i
> 
>   [Install]
>   WantedBy=sockets.target
> 
> 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):
> 
>   [Seat:seat-LVDS]
>   xserver-command=env DISPLAY=:90 Xephyr -xkb-rules evdev -xkb-layout br -xkb-model abnt2 -output LVDS
> 
>   [Seat:seat-VGA]
>   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
>    managers).
> 
> ** 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.

Merged, mostly:

remote: E: failed to find patch for rev 0cf3d72be6bd99cd2c66b7885339322c7e5bf73d.
remote: I: patch #73569 updated using rev 40e32e9fc9f3a1bd8287ee03dd399d8161cb98dd.
remote: I: patch #73570 updated using rev 851ff9ec04b73412c7dbad7b4911a1feac21f354.
remote: E: failed to find patch for rev daa6d2d58f65b9301b1b1f3c6df07719ecb5c03d.
remote: I: 2 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   2116f03..daa6d2d  master -> master

I fixed up the final patch to just add ATTR_KEY and not re-number the
rest of the values, in case someone wants to cherry-pick it to a stable
branch without breaking ABI.

- ajax


More information about the xorg-devel mailing list