brightness value changes but not the actual brightness, unless amdgpu.backlight=0 added to kernel args (gnome + nvidia/amd laptop)
Brief summary of the problem:
Recently Hans de Goede (@ gitlab.gnome.org) wrote a kernel patch to fix and let me being able to use the backlight control under Gnome in an hybrid laptop (NVIDIA/AMD) ref: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/730
The patch isn't implemented yet, but probably will soon.
The thing is that the patched kernel does work and it fixes the issue. It connects the device, but for it to work I need to have amdgpu.backlight=0
as kernel argument. Otherwise it changes the value (/sys/class/backlight/amdgpu_bl0/brightness
) but not the brightness itself.
He recommended me to write a report here for it to be fixed/checked.
I just installed Fedora 37 Workstation specially to help test the kernel. I've only installed the Nvidia drivers (rpmfusion) and two patched kernels, the last one was the one that worked. I'll probably will uninstall the first patched kernel, you can ignore it.
Hardware description:
- LAPTOP: Lenovo Legion 5 15ARH05H
- CPU: AMD Ryzen 7 4800H
- GPU: NVIDIA RTX 2060 Mobile / AMD Renoir
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] [10de:1f15] (rev a1)
06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir [1002:1636] (rev c6)
- System Memory: 16 GB
- Display(s): laptop
- Type of Display Connection: laptop
System information:
- Distro name and Version: Fedora 37 Workstation
- DE: Gnome 43.0 (Mutter 43.0)
- Kernel version: 6.2.2-301.amdgpu.fc38.x86_64 (ignore fc38 part on the name)
- Custom kernel: 6.2.2-301.amdgpu.fc38.x86_64 (ref: https://koji.fedoraproject.org/koji/taskinfo?taskID=98465226 | patches: https://fedorapeople.org/~jwrdegoede/amdgpu/ | mailing list: https://lore.kernel.org/dri-devel/20230308215831.782266-1-hdegoede@redhat.com/T/#t)
- AMD official driver version: kernel
How to reproduce the issue:
- Set the laptop on hybrid mode
- Install Fedora 37 Workstation
- Install the patched kernel that fixes backlight (amdgpu)
- Boot into the patched kernel
- Try to change the backlight with the slider or the keys
-
nothing will happen (the value of
/sys/class/backlight/amdgpu_bl0/brightness
wil change but not the light of the screen) - Now add
amdgpu.backlight=0
as kernel argument - Rebuild Grub's conf
- Reboot into the same patched kernel
- Now you have a working backlight slider and you can change the backlight with the keys
Log files (for system lockups / game freezes / crashes)
[rscm@LEGION ~]$ uname -a
Linux LEGION 6.2.2-301.amdgpu.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Mar 8 21:49:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[rscm@LEGION ~]$ cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.2.2-301.amdgpu.fc38.x86_64 root=UUID=dd4e585d-5bd3-40cf-b0b8-1c36d902bf5a ro rootflags=subvol=root rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init rhgb quiet amdgpu.backlight=0
[rscm@LEGION ~]$ ls -l /sys/class/backlight/amdgpu_bl0/
total 0
-r--r--r--. 1 root root 4096 mar 10 00:33 actual_brightness
-rw-r--r--. 1 root root 4096 mar 10 00:33 bl_power
-rw-r--r--. 1 root root 4096 mar 10 00:01 brightness
lrwxrwxrwx. 1 root root 0 mar 10 00:33 device -> ../../card0-eDP-1
-r--r--r--. 1 root root 4096 mar 10 00:01 max_brightness
drwxr-xr-x. 2 root root 0 mar 10 00:01 power
-r--r--r--. 1 root root 4096 mar 10 00:33 scale
lrwxrwxrwx. 1 root root 0 mar 10 00:01 subsystem -> ../../../../../../../../class/backlight
-r--r--r--. 1 root root 4096 mar 10 00:01 type
-rw-r--r--. 1 root root 4096 mar 10 00:01 uevent
[rscm@LEGION ~]$ rpm -qa | grep kernel
kernel-headers-6.0.5-300.fc37.x86_64
kernel-core-6.0.7-301.fc37.x86_64
kernel-modules-6.0.7-301.fc37.x86_64
kernel-6.0.7-301.fc37.x86_64
libreport-plugin-kerneloops-2.17.4-1.fc37.x86_64
abrt-addon-kerneloops-2.15.1-6.fc37.x86_64
kernel-modules-extra-6.0.7-301.fc37.x86_64
kernel-core-6.1.14-200.amdgpu.fc37.x86_64
kernel-modules-6.1.14-200.amdgpu.fc37.x86_64
kernel-6.1.14-200.amdgpu.fc37.x86_64
kernel-devel-6.1.14-200.amdgpu.fc37.x86_64
kernel-devel-matched-6.1.14-200.amdgpu.fc37.x86_64
kernel-modules-extra-6.1.14-200.amdgpu.fc37.x86_64
kernel-srpm-macros-1.0-15.fc37.noarch
kernel-modules-core-6.2.2-301.amdgpu.fc38.x86_64
kernel-core-6.2.2-301.amdgpu.fc38.x86_64
kernel-modules-6.2.2-301.amdgpu.fc38.x86_64
kernel-devel-6.2.2-301.amdgpu.fc38.x86_64
kernel-devel-matched-6.2.2-301.amdgpu.fc38.x86_64
kernel-6.2.2-301.amdgpu.fc38.x86_64
kernel-modules-extra-6.2.2-301.amdgpu.fc38.x86_64
kernel-devel-6.0.7-301.fc37.x86_64