Backlight values are a mixture of 16 bit and 8 bit and break saving and restoring levels
Brief summary of the problem:
With a change in the amdgpu kernel module, actual_brightness
in /sys/class/backlight/amdgpu_bl0
returns a 5-digit value to allow for more precision. However, both brightness
and max_brightness
return 8 bit values. With a recent commit to systemd, restoring backlight levels on boot is broken: The value in actual_brightness
will be stored, and restored to brightness
on boot. As brightness
only is 8 bit, and a 16 bit value is restored, numbers will be clamped and in turn always return maximum brightness.
Hardware description:
- CPU: AMD Ryzen 7 Pro 4750U
- GPU: AMD Radeon RX Vega 7
- System Memory: 16GB
- Display(s): IPS 1920x1080
- Type of Diplay Connection: eDP
- Laptop: Thinkpad X13
System infomration:
- Distro name and Version: Arch Linux
- Kernel version: 5.8.0-rc7
How to reproduce the issue:
- Read 16 bit value from
/sys/class/backlight/amdgpu_bl0/actual_brightness
- Write value into
/sys/class/backlight/amdgpu_bl0/brightness
- "Invalid argument" is returned because value is > 255.
Issues on other sites
- Lennart Poettering said this is a kernel issue, max_brightness and brightness apparently are expected to be in the same range as actual_brightness
- There is an issue on the Kernel.org bugzilla opened in 2019 dealing with this, however I suspect not many people have witnessed this issue since the change to systemd only happened a few weeks ago.
Any help would be appreciated :) Please let me know if you need more information.