Display backlight did not work in the linux kernel above 6.1.3
Brief summary of the problem:
Backlight device not created automatically at /sys/devices/**/backlight/
path.
Without special backlight device, the level of the display backlight is configured to 100% by BIOS. The 100% of the intensity of the the light level is very harmful - eyes can't see display more than 20-30 min.
In kernel 6.1.3 and below - special control files for backlight is created automatically at the /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight
directory. So intencity of the display backlight can be controlled to the comfort level.
I detect this problem when change kernel version from 6.1.3 to 6.1.5. Kernel versions 6.1.6 and 6.1.7 are affected too. I do not test kernel 6.1.4, as it is removed from the package manager by Gentoo portage maintaintres.
Bug firstly reported here: Bug 216954
Hardware description:
- Device: HP Pavilion Gaming Laptop 15-ec1002ur
- CPU:
AMD Ryzen 5 4600H
- GPU:
05:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir [1002:1636] (rev c7)
- System Memory:
2*4GB
or2*16GB
- the same effect - Display(s): Vendor (as hardinfo tool say):
[PNP:BOE] BOE
, Model:BOE [0852-00000000] 2130-0
- Type of Display Connection: eDP in the laptop,
1920x1080@60Hz 34.4x19.4cm (15.5") progressive normal
System information:
- Distro name and Version: Gentoo, double profile
default/linux/amd64/17.1/desktop/gnome
anddefault/linux/amd64/17.1/no-multilib/hardened/selinux
- Kernel version:
Linux pcname 6.1.5-gentoo-x86_64 #3 SMP PREEMPT_DYNAMIC Sun Jan 8 00:53:42 EET 2023 x86_64 AMD Ryzen 5 4600H with Radeon Graphics AuthenticAMD GNU/Linux
- Kernel version (without the bug):
6.1.3-gentoo-x86_64
- Custom kernel:
manual config with the standard Gentoo maintainers patches
- AMD official driver version:
N/A, amdgpu from the kernel source is used
.
How to reproduce the issue:
- Install Gentoo in default configuration.
- Update package manager database:
emerge --sync
- Install
eix
tool, which helps to find packages and versions in comfort style.emerge eix
- Generate eix cache database (convert package manager database to format, which eix support).
eix-update
- See which versions of the kernel are presented (supported) in the package manager:
eix gentoo-sources
This command prints the list of supported versions of the package. The fully qualified package name issys-kernel/gentoo-sources
. - Select some version of the kernel from the
eix
results at previous step: For example, I choose version 6.1.5 (at now, version 6.1.4 is not supported by the gentoo maintainers). - Allow to install unstable package:
At now, version 6.1.5 marked as
unstable
and by default - disabled to install. Need custom step to allow to install unstable version of the package.echo "=sys-kernel/gentoo-sources-6.1.5" >> /etc/portage/package.accept_keywords/custom
- Install kernel sources with selected version (not the latest stable version):
emerge "=sys-kernel/gentoo-sources-6.1.5"
- See the list of installed kernels:
eselect kernel list
Select kernel version by the number or by the name in the list. - Change default version of the kernel: '''eselect kernel set linux-6.1.5-gentoo```
- Put manual kernel config to the kernel tree (my kernel config is attached):
cp kernel.config /usr/src/linux/.config
- Rebuild the kernel and modules with attached config.
Package
sys-kernel/genkernel
may help to build and install kernel binaries and modules in one command. Details: https://wiki.gentoo.org/wiki/Genkernel - Install kernel binaries and modules.
- Start computer with compiled kernel.
- Detect present of special files for backlight device:
find /sys/devices/**/backlight
The sample of correct output (kernel 6.1.3), if the backlight device is detected and special files are created:
find /sys/devices/**/backlight
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/uevent
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/actual_brightness
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/bl_power
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/brightness
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/power
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/power/runtime_active_time
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/power/runtime_status
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/power/autosuspend_delay_ms
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/power/runtime_suspended_time
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/power/control
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/device
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/type
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/scale
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/subsystem
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/backlight/amdgpu_bl0/max_brightness