[gdm/disable-hybrid-nvidia: 2/2] data: Disable GDM on hybrid graphics laptops with vendor NVidia driver




commit 31f0d714133e25c53fe98d0fa4a0f76f68313566
Author: Ray Strode <rstrode redhat com>
Date:   Tue Feb 15 08:36:28 2022 -0500

    data: Disable GDM on hybrid graphics laptops with vendor NVidia driver
    
    We really don't want wayland on hybrid graphics laptops, because
    certain connectors won't work right now.
    
    This commit tries to detect the case and disable it.

 data/61-gdm.rules.in | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
---
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
index 9451c12e7..bb0e75c77 100644
--- a/data/61-gdm.rules.in
+++ b/data/61-gdm.rules.in
@@ -16,8 +16,36 @@ KERNEL!="nvidia", GOTO="gdm_nvidia_end"
 SUBSYSTEM!="module", GOTO="gdm_nvidia_end"
 ACTION!="add", GOTO="gdm_nvidia_end"
 RUN+="@bindir@/touch /run/udev/gdm-waiting-on-udev"
+RUN+="@bindir@/touch /run/udev/gdm-machine-has-vendor-nvidia-driver"
 LABEL="gdm_nvidia_end"
 
+# If this machine has an internal panel, take note, since it's probably a laptop
+# FIXME: It could be "ghost connectors" make this pop positive for some workstations
+# in the wild. If so, we may have to fallback to looking at the chassis type from
+# dmi data or acpi
+KERNEL!="card[0-9]-eDP-*", GOTO="gdm_laptop_check_end"
+SUBSYSTEM!="drm", GOTO="gdm_laptop_check_end"
+ACTION!="add", GOTO="gdm_laptop_check_end"
+RUN+="@bindir@/touch /run/udev/gdm-machine-is-laptop"
+GOTO="gdm_hybrid_nvidia_laptop_check"
+LABEL="gdm_laptop_check_end"
+
+# If this is a hybrid graphics setup, take note
+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+="@bindir@/touch /run/udev/gdm-machine-has-hybrid-graphics"
+GOTO="gdm_hybrid_nvidia_laptop_check"
+LABEL="gdm_hybrid_graphics_check_end"
+
+# If this is a hybrid graphics laptop with vendor nvidia driver, disable wayland
+LABEL="gdm_hybrid_nvidia_laptop_check"
+TEST!="/run/udev/gdm-machine-is-laptop", GOTO="gdm_hybrid_nvidia_laptop_check_end"
+TEST!="/run/udev/gdm-machine-has-hybrid-graphics", GOTO="gdm_hybrid_nvidia_laptop_check_end"
+TEST!="/run/udev/gdm-machine-has-vendor-nvidia-driver", GOTO="gdm_hybrid_nvidia_laptop_check_end"
+GOTO="gdm_disable_wayland"
+LABEL="gdm_hybrid_nvidia_laptop_check_end"
+
 # Disable wayland when nvidia modeset is disabled or when drivers are a lower
 # version than 470,
 # For versions above 470 but lower than 510 prefer Xorg,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]