Vendor nvidia wayland hybrid graphics udev change

Allow users with hybrid machines with vendor nvidia driver to elect to
use the wayland session from the login screen menu.

Resolves: #2128910
This commit is contained in:
Ray Strode 2022-09-27 09:10:12 -04:00
parent 41babe2cdc
commit 27625e5ff8
2 changed files with 102 additions and 1 deletions

View File

@ -0,0 +1,95 @@
From cc376327163a2c75487b07fa26880bf7a3b080fa Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 27 Sep 2022 09:04:54 -0400
Subject: [PATCH] udev: Allow wayland on hybrid vendor nvidia machines
We currently disable wayland on machines with the vendor
nvidia driver upstream if hybrid graphics are in place because there
is poor performance for multimonitor use cases.
But springing that change on users in F37 this late in the game
isn't nice, so instead default to Xorg and provide wayland as an
option in the menu.
https://bugzilla.redhat.com/show_bug.cgi?id=2128910
---
data/61-gdm.rules.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
index 5bc9941..7e17be0 100644
--- a/data/61-gdm.rules.in
+++ b/data/61-gdm.rules.in
@@ -57,66 +57,67 @@ TEST{0711}!="/usr/bin/nvidia-sleep.sh", GOTO="gdm_disable_wayland"
TEST{0711}!="/usr/lib/systemd/system-sleep/nvidia", GOTO="gdm_disable_wayland"
IMPORT{program}="/bin/sh -c \"sed -e 's/: /=/g' -e 's/\([^[:upper:]]\)\([[:upper:]]\)/\1_\2/g' -e 's/[[:lower:]]/\U&/g' -e 's/^/NVIDIA_/' /proc/driver/nvidia/params\""
ENV{NVIDIA_PRESERVE_VIDEO_MEMORY_ALLOCATIONS}!="1", GOTO="gdm_disable_wayland"
IMPORT{program}="/bin/sh -c 'echo NVIDIA_HIBERNATE=`systemctl is-enabled nvidia-hibernate`'"
ENV{NVIDIA_HIBERNATE}!="enabled", GOTO="gdm_disable_wayland"
IMPORT{program}="/bin/sh -c 'echo NVIDIA_RESUME=`systemctl is-enabled nvidia-resume`'"
ENV{NVIDIA_RESUME}!="enabled", GOTO="gdm_disable_wayland"
IMPORT{program}="/bin/sh -c 'echo NVIDIA_SUSPEND=`systemctl is-enabled nvidia-suspend`'"
ENV{NVIDIA_SUSPEND}!="enabled", GOTO="gdm_disable_wayland"
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+="/usr/bin/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"
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"
LABEL="gdm_hybrid_graphics_check_end"
-# If this is a hybrid graphics laptop with vendor nvidia driver, disable wayland
+# If this is a hybrid graphics laptop with vendor nvidia driver, prefer xorg since
+# multimonitor has very poor performance
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"
+GOTO="gdm_prefer_xorg"
LABEL="gdm_hybrid_nvidia_laptop_check_end"
# Disable wayland in situation where we're in a guest with a virtual gpu and host passthrough gpu
LABEL="gdm_virt_passthrough_check"
TEST!="/run/udev/gdm-machine-has-hybrid-graphics", GOTO="gdm_virt_passthrough_check_end"
TEST!="/run/udev/gdm-machine-has-virtual-gpu", GOTO="gdm_virt_passthrough_check_end"
TEST!="/run/udev/gdm-machine-has-hardware-gpu", GOTO="gdm_virt_passthrough_check_end"
GOTO="gdm_disable_wayland"
LABEL="gdm_virt_passthrough_check_end"
# Disable wayland when there are multiple virtual gpus
LABEL="gdm_virt_multi_gpu_check"
TEST!="/run/udev/gdm-machine-has-hybrid-graphics", GOTO="gdm_virt_multi_gpu_check_end"
TEST!="/run/udev/gdm-machine-has-virtual-gpu", GOTO="gdm_virt_multi_gpu_check_end"
TEST=="/run/udev/gdm-machine-has-hardware-gpu", GOTO="gdm_virt_multi_gpu_check_end"
LABEL="gdm_virt_multi_gpu_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,
# Above 510, prefer Wayland.
KERNEL!="nvidia_drm", GOTO="gdm_nvidia_drm_end"
SUBSYSTEM!="module", GOTO="gdm_nvidia_drm_end"
ACTION!="add", GOTO="gdm_nvidia_drm_end"
# disable wayland if nvidia-drm modeset is not enabled
ATTR{parameters/modeset}!="Y", GOTO="gdm_disable_wayland"
# disable wayland for nvidia drivers versions lower than 470
ATTR{version}=="4[0-6][0-9].*|[0-3][0-9][0-9].*|[0-9][0-9].*|[0-9].*", GOTO="gdm_disable_wayland"
# For nvidia drivers versions Above 510, keep Wayland by default
ATTR{version}=="[5-9][1-9][0-9].*", GOTO="gdm_end"
--
2.35.1

View File

@ -11,7 +11,7 @@
Name: gdm Name: gdm
Epoch: 1 Epoch: 1
Version: 43.0 Version: 43.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: The GNOME Display Manager Summary: The GNOME Display Manager
License: GPLv2+ License: GPLv2+
@ -25,6 +25,7 @@ Source5: default.pa-for-gdm
Source6: gdm.sysusers Source6: gdm.sysusers
# Downstream patches # Downstream patches
Patch70001: 0001-udev-Allow-wayland-on-hybrid-vendor-nvidia-machines.patch
Patch80001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch Patch80001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch
Patch90001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch Patch90001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch
@ -300,6 +301,11 @@ fi
%{_libdir}/pkgconfig/gdm-pam-extensions.pc %{_libdir}/pkgconfig/gdm-pam-extensions.pc
%changelog %changelog
* Tue Sep 27 2022 Ray Strode <rstrode@redhat.com> - 1:43.0-2
- Allow users with hybrid machines with vendor nvidia driver to
elect to use the wayland session from the login screen menu.
Resolves: #2128910
* Tue Sep 20 2022 Kalev Lember <klember@redhat.com> - 1:43.0-1 * Tue Sep 20 2022 Kalev Lember <klember@redhat.com> - 1:43.0-1
- Update to 43.0 - Update to 43.0