Skip to content

Commit

Permalink
udev: Remove rules for disabling Wayland if nomodeset
Browse files Browse the repository at this point in the history
This rule is wrong. The way it's written it will Wayland iff:
1) nomodeset is passed
2) some DRM device registers
3) the DRM device is not SimpleDRM

The logic is wrong because:
* on systems without SimpleDRM rule 2 would fail
* on nvidia, which ignores `nomodeset`, rule 3 would match

So it is not disabling Wayland when it should, and it is when it shouldn't.

We don't need to disable Wayland now, we can let GDM try and if it does
not find any suitable DRM device it will automatically fall back to Xorg.
  • Loading branch information
aleasto committed Oct 23, 2024
1 parent e493d64 commit 22274fb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions data/61-gdm.rules.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", GOTO="gdm_disable_wayland"

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"
# but keep it enabled for simple framebuffer drivers
DRIVERS=="simple-framebuffer", GOTO="gdm_nomodeset_end"
# If this machine has a hardware GPU, take note
KERNEL!="card[0-9]*", GOTO="gdm_hardware_gpu_end"
KERNEL=="card[0-9]-*", GOTO="gdm_hardware_gpu_end"
SUBSYSTEM!="drm", GOTO="gdm_hardware_gpu_end"
DRIVERS=="simple-framebuffer", GOTO="gdm_hardware_gpu_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"
LABEL="gdm_hardware_gpu_end"

# The vendor nvidia driver has multiple modules that need to be loaded before GDM can make an
# informed choice on which way to proceed, so force GDM to wait until NVidia's modules are
Expand Down

0 comments on commit 22274fb

Please sign in to comment.