summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2023-03-01 22:50:49 -0500
committerRay Strode <rstrode@redhat.com>2023-03-02 09:25:24 -0500
commit72bde3b3f474135e792c6c4e40932d7c82f87985 (patch)
treee1aad31d738651318c3f4978413b69ab36edd9c3 /data
parent9865742ef969a447a9b5b2fd353f3815c7e98bf7 (diff)
downloadgdm-72bde3b3f474135e792c6c4e40932d7c82f87985.tar.gz
udev: Try to detect virtual graphics and EFI better
With EFI and simpledrm we may end up booting without a card0 but with a card1 drm device. This defeats GDM's simplistic hybrid graphics check. Also, our detection for virtio graphics wasn't working so well, because it wrote the results into an environment variable of a non-parent device. This commit gets the detection logic working better for virt/efi setups. Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/832
Diffstat (limited to 'data')
-rw-r--r--data/61-gdm.rules.in19
1 files changed, 9 insertions, 10 deletions
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
index 5bc9941c..b829a46f 100644
--- a/data/61-gdm.rules.in
+++ b/data/61-gdm.rules.in
@@ -1,19 +1,15 @@
-# identify virtio graphics cards to find passthrough setups
-SUBSYSTEM!="virtio", GOTO="gdm_virtio_device_end"
-ACTION!="add", GOTO="gdm_virtio_device_end"
-ATTR{vendor}=="0x1af4", ATTR{device}=="0x0010", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_virtio_device_end"
-LABEL="gdm_virtio_device_end"
-
SUBSYSTEM!="pci", GOTO="gdm_pci_device_end"
-ACTION!="bind", GOTO="gdm_pci_device_end"
+ACTION!="bind", ACTION!="add", GOTO="gdm_pci_device_end"
# identify virtio graphics cards to find passthrough setups
# cirrus
ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
+ATTR{vendor}=="0x1af4", ATTR{device}=="0x1050", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
# vga
ATTR{vendor}=="0x1b36", ATTR{device}=="0x0100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
# qxl
ATTR{vendor}=="0x1234", ATTR{device}=="0x1111", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
+ATTR{vendor}=="0x1af4", ATTR{device}=="0x1050", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
# disable Wayland on Hi1710 chipsets
ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", GOTO="gdm_disable_wayland"
@@ -36,11 +32,12 @@ LABEL="gdm_pci_device_end"
# disable Wayland if modesetting is disabled
KERNEL!="card[0-9]*", GOTO="gdm_nomodeset_end"
+KERNEL=="card[0-9]-*", GOTO="gdm_nomodeset_end"
SUBSYSTEM!="drm", GOTO="gdm_nomodeset_end"
-IMPORT{parent}="GDM_MACHINE_HAS_VIRTUAL_GPU"
-ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}!="1", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-hardware-gpu"
# but keep it enabled for simple framebuffer drivers
DRIVERS=="simple-framebuffer", GOTO="gdm_nomodeset_end"
+IMPORT{parent}="GDM_MACHINE_HAS_VIRTUAL_GPU"
+ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}!="1", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-hardware-gpu"
IMPORT{cmdline}="nomodeset", GOTO="gdm_disable_wayland"
LABEL="gdm_nomodeset_end"
@@ -81,7 +78,9 @@ KERNEL!="card[1-9]*", GOTO="gdm_hybrid_graphics_check_end"
KERNEL=="card[1-9]-*", GOTO="gdm_hybrid_graphics_check_end"
SUBSYSTEM!="drm", GOTO="gdm_hybrid_graphics_check_end"
ACTION!="add", GOTO="gdm_hybrid_graphics_check_end"
-RUN+="/usr/bin/touch /run/udev/gdm-machine-has-hybrid-graphics"
+IMPORT{program}="/bin/sh -c \"echo GDM_NUMBER_OF_GRAPHICS_CARDS=`ls -1d /sys/class/drm/card[0-9] | wc -l`\""
+ENV{GDM_NUMBER_OF_GRAPHICS_CARDS}=="1", RUN+="/usr/bin/rm -f /run/udev/gdm-machine-has-hybrid-graphics"
+ENV{GDM_NUMBER_OF_GRAPHICS_CARDS}!="1", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-hybrid-graphics"
LABEL="gdm_hybrid_graphics_check_end"
# If this is a hybrid graphics laptop with vendor nvidia driver, disable wayland