FS#73720 - [linux-zen] using new DRM based Linux fb driver instead legacy fbdev driver as Fedora do

Attached to Project: Arch Linux
Opened by Celeste (Coelacanthus) - Thursday, 10 February 2022, 15:18 GMT
Last edited by Toolybird (Toolybird) - Monday, 25 September 2023, 06:05 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Since 5.14, linux kernel provide new DRM fbdev emulate layer.
As Fedora said, a well-maintained modern driver is better than an old driver, which is even leak maintained.
So I suggest linux-zen enable this new driver as Fedora do. Fedora also lists some benefits in link below.

https://fedoraproject.org/wiki/Changes/ReplaceFbdevDrivers
This task depends upon

Closed by  Toolybird (Toolybird)
Monday, 25 September 2023, 06:05 GMT
Reason for closing:  Implemented
Comment by loqs (loqs) - Thursday, 10 February 2022, 23:17 GMT
This was attempted see  FS#72645 
Comment by Marcos Mello (marcosfrm) - Saturday, 29 April 2023, 01:47 GMT
It is a nice feature have a decent failsafe option for Wayland and Xorg (https://gitlab.freedesktop.org/xorg/xserver/-/commit/b89fdd523e2c9e9b0cdf37b263833c4b0a8868b8).

They will go even further in Fedora 39:

https://fedoraproject.org/wiki/Changes/LegacyXorgDriverRemoval

What a shame NVIDIA.
Comment by Marcos Mello (marcosfrm) - Saturday, 29 April 2023, 02:14 GMT Comment by Jan Alexander Steffens (heftig) - Saturday, 29 April 2023, 02:44 GMT
This is still broken with 525, see  FS#77603 .
Comment by Marcos Mello (marcosfrm) - Saturday, 29 April 2023, 23:07 GMT
 FS#77603  was with 525.89.02.

525.105.17 release notes:

"Added support for console restoration when using simpledrm."

https://www.nvidia.com/download/driverResults.aspx/202504/

Who knows...
Comment by Marcos Mello (marcosfrm) - Monday, 31 July 2023, 23:58 GMT
Setting CONFIG_SYSFB_SIMPLEFB=y (*keeping* CONFIG_FB_EFI=y, CONFIG_FB_VESA=y) and carrying this patch downstream would be too much?

https://gitlab.com/cki-project/kernel-ark/-/commit/811fe0e4dcfd86a0db5135d3bfef4936794efdb6
(buried here: https://src.fedoraproject.org/rpms/kernel/blob/f38/f/patch-6.4-redhat.patch )
Comment by Jan Alexander Steffens (heftig) - Tuesday, 01 August 2023, 00:03 GMT
I'll consider it.
Comment by Jan Alexander Steffens (heftig) - Thursday, 03 August 2023, 19:30 GMT
linux 6.4.8.arch1-1 has the patch and the config enabled.
Comment by Marcos Mello (marcosfrm) - Thursday, 03 August 2023, 23:38 GMT
Working fine on Intel hardware. Anyone with Nvidia drivers? (nvidia-drm.modeset=1 cmdline is required)
Comment by Marcos Mello (marcosfrm) - Monday, 07 August 2023, 19:10 GMT
Should this be implemented in linux-lts too?
Comment by Toolybird (Toolybird) - Tuesday, 08 August 2023, 21:45 GMT
> Anyone with Nvidia drivers? (nvidia-drm.modeset=1 cmdline is required)

@marcosfrm, please see  FS#79306  (even though it looks like a hyprland crash, maybe this kernel config option is the cause?). Any comments?
Comment by Marcos Mello (marcosfrm) - Tuesday, 08 August 2023, 22:09 GMT
If nvidia-drm.modeset=1 is set, kernel should behave as before (CONFIG_SYSFB_SIMPLEFB not set). From the reports I have seen, without the patch VTs would simply not work.
Comment by Nikita (mcmodder) - Wednesday, 09 August 2023, 08:31 GMT
> Anyone with Nvidia drivers? (nvidia-drm.modeset=1 cmdline is required)
After upgrading my kernel from 6.4.7.arch1-3 to 6.4.8.arch1-1 and 6.4.9.arch1 GDM cannot start Wayland nor X anymore due to segfault (see attachment)

I do not have nvidia-drm.modeset=1 in kernel cmdline, but do in /etc/modprobe.d/nvidia-drm.conf:
➜ cat /etc/modprobe.d/nvidia-drm.conf
options nvidia_drm modeset=1

I tried to add nvidia modules to initrd and move nvidia_drm modeset=1 to kernel cmdline, but got no effect
When using 6.4.7.arch1-3 kernel I'm able to run both X and Wayland sessions:
➜ echo $XDG_SESSION_TYPE
wayland
Comment by Marcos Mello (marcosfrm) - Wednesday, 09 August 2023, 09:47 GMT
Can you post /proc/cmdline contents?
Comment by Nikita (mcmodder) - Wednesday, 09 August 2023, 12:19 GMT
I checked /proc/cmdline and found a misconfiguration. I added nvidia-drm.modeset=1 kernel option to wrong config, so it was not applied.
With nvidia-drm.modeset=1 in kernel cmdline, even without nvidia modules in initrd, X/Wayland starts normally.
If nvidia-drm.modeset=1 kernel options is absent, nvidia driver starts to segfault even if modeset is enabled using /etc/modprobe.d/.

My current cmdline is "init=/usr/lib/systemd/systemd quiet loglevel=3 rd.systemd.show_status=auto rd.udev.log_priority=3 modules-load=nvidia nvidia-drm.modeset=1"
My misconfigured cmdline was "init=/usr/lib/systemd/systemd quiet loglevel=3 rd.systemd.show_status=auto rd.udev.log_priority=3 modules-load=nvidia"
Comment by Marcos Mello (marcosfrm) - Wednesday, 09 August 2023, 12:31 GMT
> With nvidia-drm.modeset=1 in kernel cmdline, even without nvidia modules in initrd, X/Wayland starts normally.

Great.

We should mention in the Wiki nvidia-drm.modeset=1 is required now. Btw, the option is wrong there:

https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
Comment by salim (salimp2009) - Wednesday, 09 August 2023, 15:56 GMT
as a Arch and Hyprland user (not an experienced Arch user as you all), I just updated linux 6.4.9 and uncommented an environment variable before launching Hyprland and it worked.
# env = GBM_BACKEND,nvidia-drm
(which was set in hyprland.conf) (this could have been set .bashrc/.bash_profile)

I also have
> cat /etc/modprobe.d/nvidia.conf
options nvidia_drm modeset=1

Also have this
> cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-linux root=UUID=223628a8-299a-4e2b-84b8-e6ea139ffa49 rw loglevel=3 quiet

I did not have the GRUB_CMDLINE_DEFAULT option set.
Although Hyprland updated wiki has the kernel command line option as ;
"...
For people using systemd-boot you can do this adding nvidia_drm.modeset=1 to the end of /boot/loader/entries/arch.conf. For people using grub you can do this by adding nvidia_drm.modeset=1 to the end of GRUB_CMDLINE_LINUX_DEFAULT= in /etc/default/grub, then run # grub-mkconfig -o /boot/grub/grub.cfg
..."
I thought this might help too.
Comment by Marcos Mello (marcosfrm) - Wednesday, 09 August 2023, 17:06 GMT
The kernel command line option is nvidia-drm.modeset=1, not nvidia_drm.modeset=1.

@salimp2009 starting with 6.4.8.arch1-1 and 6.4.8.zen1-1, if you do not set nvidia-drm.modeset=1, simpledrm *will* activate. Nvidia added some code to support it in 525 branch with mixed success reports. Maybe it is working for you...

Btw, openSUSE kernels have the same patch.
Comment by salim (salimp2009) - Wednesday, 09 August 2023, 19:20 GMT
ok. sorry for the typo. I have nvidia-drm modeset=1 in nvidia.conf
So I guess misunderstood prev comment about nvidia-drm.modeset=1 is needed in kernel cmdline
Comment by Marcos Mello (marcosfrm) - Wednesday, 09 August 2023, 19:37 GMT
Sorry, I was wrong. Actually the driver accepts both nvidia-drm.modeset=1 and nvidia_drm.modeset=1 since it uses module_param_named():

https://github.com/NVIDIA/open-gpu-kernel-modules/blob/535.98/kernel-open/nvidia-drm/nvidia-drm-linux.c#L46

Fedora patch uses early_param() therefore will work with both. Hence the Wiki is ok.

Loading...