Blob Blame History Raw
From 2259b85e4722ec81a11229e3f2d8abb1b3e93a8b Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip.withnall@collabora.co.uk>
Date: Tue, 2 Jun 2015 15:24:48 +0100
Subject: [PATCH] logind: Add a udev rule to tag all DRM cards with
 master-of-seat
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is needed for generic DRM devices like the VirtualBox vboxvideo
driver, which exposes itself as a generic, ID-less DRM device at
/dev/dri/card0 (after applying this commit):
   $ udevadm info --query=all --path \
      /sys/devices/pci0000:00/0000:00:02.0/drm/card0
   P: /devices/pci0000:00/0000:00:02.0/drm/card0
   N: dri/card0
   E: DEVNAME=/dev/dri/card0
   E: DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
   E: DEVTYPE=drm_minor
   E: ID_FOR_SEAT=drm-pci-0000_00_02_0
   E: ID_PATH=pci-0000:00:02.0
   E: ID_PATH_TAG=pci-0000_00_02_0
   E: MAJOR=226
   E: MINOR=0
   E: SUBSYSTEM=drm
   E: TAGS=:master-of-seat:seat:uaccess:
   E: USEC_INITIALIZED=59893

Without this patch, the capabilities for a seat on a VirtualBox
installation of systemd v219 incorrectly show it as non-graphical, even
though I can type these commands from an xterm:
   $ loginctl show-seat seat0
   Id=seat0
   CanMultiSession=yes
   CanTTY=yes
   CanGraphical=no
   …

https://bugs.freedesktop.org/show_bug.cgi?id=90822
(cherry picked from commit ed817cd4e58c5f5c868d5d9e59a1d7e66b1da165)
---
 src/login/71-seat.rules.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/login/71-seat.rules.in b/src/login/71-seat.rules.in
index ad26acbbb3..ab7b66f651 100644
--- a/src/login/71-seat.rules.in
+++ b/src/login/71-seat.rules.in
@@ -11,6 +11,7 @@ TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat"
 SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"
 SUBSYSTEM=="input", KERNEL=="input*", TAG+="seat"
 SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat", TAG+="master-of-seat"
+SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="seat", TAG+="master-of-seat"
 SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat"
 
 # 'Plugable' USB hub, sound, network, graphics adapter