AMD (amdgpu_bl0) backlight not restored

In Fedora 32 Silverblue on IdeaPad 5 15ARE05 the backlight does not seem to be correctly handled/restored.

Problems:

  • it is very bright (though I’m not sure whether this is intended)
  • it often/always(?) does not restore the backlight at boot (it juses uses the highest brightness instead)
  • I can basically adjust it and see a difference, but the +/- slider is not “smooth” and it only seem to have 19 steps or so.

CPU: AMD Ryzen 7 4800U
GPU: AMD Renoir

$ systemctl status systemd-backlight@backlight
● systemd-backlight@backlight.service - Load/Save Screen Backlight Brightness of backlight
    Loaded: loaded (/usr/lib/systemd/system/systemd-backlight@.service; static; vendor preset: disabled)
    Active: inactive (dead)
    Docs: man:systemd-backlight@.service(8)

Also here some interesting logs:

Jun 04 23:58:40 systemd-backlight[1118]: amdgpu_bl0: Saved brightness 2 too low; increasing to 12.
Jun 04 23:58:40 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-backlight@backlight:amdgpu_bl0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[…]
Jun 04 13:37:53 systemd[1]: Created slice system-systemd\x2dbacklight.slice.
Jun 04 13:37:54 systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0...
Jun 04 13:37:54 systemd[1127]: systemd-backlight@backlight:amdgpu_bl0.service: Failed to set up special execution directory in /var/lib: Read-only file system
Jun 04 13:37:54 systemd[1127]: systemd-backlight@backlight:amdgpu_bl0.service: Failed at step STATE_DIRECTORY spawning /usr/lib/systemd/systemd-backlight: Read-only file system
Jun 04 13:37:54 systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Main process exited, code=exited, status=238/STATE_DIRECTORY
Jun 04 13:37:54 systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Failed with result 'exit-code'.
Jun 04 13:37:54 systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0.
Jun 04 13:37:54 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-backlight@backlight:amdgpu_bl0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'

What’s also very strange:
I can cat /var/lib/systemd/backlight/pci-0000\:03\:00.0\:backlight\:amdgpu_bl0 and always get 12.
No matter, what brightness level the screen currently has.

$ ls /sys/class/backlight/amdgpu_bl0/*
/sys/class/backlight/amdgpu_bl0/actual_brightness
/sys/class/backlight/amdgpu_bl0/bl_power
/sys/class/backlight/amdgpu_bl0/brightness
/sys/class/backlight/amdgpu_bl0/max_brightness
/sys/class/backlight/amdgpu_bl0/scale
/sys/class/backlight/amdgpu_bl0/type
/sys/class/backlight/amdgpu_bl0/uevent

/sys/class/backlight/amdgpu_bl0/device:
ari_enabled               modalias
backlight                 msi_bus
boot_vga                  msi_irqs
broken_parity_status      numa_node
class                     pcie_replay_count
config                    power
consistent_dma_mask_bits  power_dpm_force_performance_level
current_link_speed        power_dpm_state
current_link_width        pp_cur_state
d3cold_allowed            pp_dpm_dcefclk
device                    pp_dpm_fclk
dma_mask_bits             pp_dpm_mclk
driver                    pp_dpm_pcie
driver_override           pp_dpm_sclk
drm                       pp_dpm_socclk
enable                    pp_force_state
firmware_node             pp_mclk_od
fw_version                pp_num_states
gpu_busy_percent          pp_power_profile_mode
graphics                  pp_sclk_od
hwmon                     pp_table
i2c-2                     remove
i2c-4                     rescan
i2c-5                     reset
iommu                     resource
iommu_group               resource0
irq                       resource0_wc
link                      resource2
local_cpulist             resource2_wc
local_cpus                resource4
max_link_speed            resource5
max_link_width            revision
mem_info_gtt_total        subsystem
mem_info_gtt_used         subsystem_device
mem_info_vis_vram_total   subsystem_vendor
mem_info_vis_vram_used    uevent
mem_info_vram_total       vbios_version
mem_info_vram_used        vendor
mem_info_vram_vendor

/sys/class/backlight/amdgpu_bl0/power:
autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
control               runtime_status

/sys/class/backlight/amdgpu_bl0/subsystem:
amdgpu_bl0
$ grep ^ /dev/null *
actual_brightness:22102
bl_power:0
brightness:86
grep: device: Ist ein Verzeichnis
max_brightness:255
grep: power: Ist ein Verzeichnis
scale:unknown
grep: subsystem: Ist ein Verzeichnis
type:raw
$ cd /sys/class/backlight/amdgpu_bl0/power
$ grep ^ /dev/null *
grep: autosuspend_delay_ms: Eingabe-/Ausgabefehler
control:auto
runtime_active_time:0
runtime_status:unsupported
runtime_suspended_time:0

Interestingly the things in /sys/class/backlight/amdgpu_bl0 seem to “work”.

This is the data reported at lowest brightness:

$ grep ^ /dev/null *
actual_brightness:514
bl_power:0
brightness:2
grep: device: Ist ein Verzeichnis
max_brightness:255
grep: power: Ist ein Verzeichnis
scale:unknown
grep: subsystem: Ist ein Verzeichnis
type:raw

And this at highest brightness:

$ grep ^ /dev/null *
actual_brightness:65535
bl_power:0
brightness:255
grep: device: Ist ein Verzeichnis
max_brightness:255
grep: power: Ist ein Verzeichnis
scale:unknown
grep: subsystem: Ist ein Verzeichnis
type:raw

system information/logs


Where can I report this?
Or is there a workaround?
I’ve seen similar issues

Is this a systemd error? Or does systemd-backlight only save/store the current value?


overview: other issues of this device

Looks like your issue has the same cause as this bug in the amdgpu driver, which is currently in discussion.
https://bugzilla.kernel.org/show_bug.cgi?id=203905

1 Like

I’ve BTW reported a possibly related issue where the screen goes just black when you press the “decrease screen backlight” key on your keyboard:

https://bugzilla.redhat.com/show_bug.cgi?id=1971779

I’ve got an issue with Fedora 33/34/35 Silverblue on IdeaPad 5 15ARE05 (Lenovo Yoga Slim 7) and brightness and wondered if anyone can help either:

  1. Confirm the issue is happening on their Yoga Slim 7 too? (OP can you help?)
  2. Help try to fix the issue?

The function keys for brightness work on both power connected and disconnected.
The brightness slider works in the Gnome menu on both power connected and disconnected.

The issue I have is that:
(The brightness values are from “cat /sys/class/backlight/amdgpu_bl0/actual_brightness”)

Using Gnome slider in menu:
After reboot brightness is at 128, if I plug the power cable in the screen dims to 20.
If I unplug the power the brightness stays at 20.
If I use the brightness slider to go to 128 then plug the power cable back in it then stays at 128.
Subsequent power cable connections and disconnections the brightness stays where it should be.

Using Fn key and brightness keys:
After reboot brightness is at 128, if I plug the power cable in the screen dims to 20.
If I unplug the power the brightness stays at 20.
If I use the fn keys and brightness to go to 128 then plug the power cable back in it then stays at 128.
Subsequent power cable connections and disconnections the brightness stays where it should be.

Using power cable connected and Fn key and brightness keys:
I’ve also tried a reboot with the power cable connected, brightness is at 128, if I unplug the power cable the screen dims to 20.
If I plugin the power the brightness stays at 20.
If I use the fn keys and brightness to go to 128 then it and unplug the power cable it stays at 128.
Subsequent power cable connections and disconnections the brightness stays where it should be.

It appears there is an issue with brightness and the first time the power cable is plugged in or removed?? I’ve had this issue on the last 3 releases.
Any help would be very much appreciated.

I’ve just seen that this isn’t tagged for the “Silverblue” forum.
Could the mods let me know if I should create another topic in the SIlverblue forum?
Or is there a way to link this to the Silverblue forum?
Thanks