Linux exposes a special interface to control screen brightness via sysfs
in /sys/class/backlight
(source).
The problem is that in Lenovo Legion 5 there are two modules registered to control screen brightness - AMDGPU and ideapad modules:
$ ls /sys/class/backlight
amdgpu_bl0
ideapad
On boot, GNOME and other DE uses ideapad
module to control brightness instead of correct amdgpu_bl0
.
This solution is tested in GNOME with Wayland and should work in X11 sessions as well.
- Set Switchable Graphics option in BIOS
- Install AMDGPU driver and ensure that it's loaded (
lsmod | grep amdgpu
)
- Disable backlight sync for
ideapad
backlight module
sudo systemctl mask systemd-backlight@backlight\:ideapad
- Set ACPI backlight type in Linux boot params
GRUB (default option for most distros)
Open /etc/default/grub
and modify GRUB_CMDLINE_LINUX_DEFAULT
variable:
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
- GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
+ GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noveau.modeset=0 acpi_backlight=native"
Rebuild grub config and initramfs:
sudo update-grub
Other bootloaders (like systemd-boot)
Add noveau.modeset=0 acpi_backlight=native
to Linux boot params.
this fix does not work for me (Lgion 5 pro, 16ARX8 using nouveau on arch).
Backlight stays always off.