Legion 5: no backlight control in Discrete graphics mode

As I mentioned here Ryzen 7 + GTX 1660Ti: blank screen on external outputs in Hybrid graphics mode:

Backlight control was working with kernel 5.9.1 and driver 455.23.
I am now on kernel 5.9.9 and driver 455.45.01 and it stopped working.

Tried reverting back to kernel 5.9.1 and drivers 455.23… but no luck. I’m not sure how to proceed since I cannot replicate my old configuration, and it just stopped working.

The laptop is in Discrete mode, with only the NVIDIA graphics card enabled, the integrated AMD gpu is disabled. In Windows everything works fine.

Are the new drivers disabling / ignoring the “RegistryDwords” “EnableBrightnessControl=1;” Xorg option?

There are many threads online discussing this, but none of the solutions work. This appears to be a widespread problem and it occurs in both Discrete and Hybrid graphics mode selected on the BIOS.






Log attached.

nvidia-bug-report.log.gz (448.4 KB)

i have the intel variant of the legion 5 but 2 things were needed for backlight control, enabling brightness control in the xorg configuration as you mentioned above and making sure acpid.service is enabled/running

 Loaded: loaded (/usr/lib/systemd/system/acpid.service; enabled; vendor preset: disabled)
 Active: active (running) since Tue 2020-11-24 15:16:03 EST; 2min 33s ago
   Docs: man:acpid(8)
   Main PID: 464 (acpid)
  Tasks: 1 (limit: 19051)
 Memory: 476.0K
 CGroup: /system.slice/acpid.service
         └─464 /usr/bin/acpid --foreground --netlink

Nov 24 15:17:22 archlinux root[2399]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:17:22 archlinux root[2409]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:17:22 archlinux root[2414]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:17:22 archlinux root[2419]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:18:32 archlinux root[2627]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:18:33 archlinux root[2646]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:18:35 archlinux root[2740]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:18:35 archlinux root[2750]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:18:35 archlinux root[2755]: ACPI group/action undefined: video/brightnessup / BRTUP
Nov 24 15:18:35 archlinux root[2762]: ACPI group/action undefined: video/brightnessup / BRTUP

@dglt unfortunately that doesn’t work for me, I think the AMD and Intel version might be different in this regard.

acpid is enabled, but no brightness events are registered when I press the keys. Are you using the laptop in Discrete or Hybrid mode? I believe that also plays a major role. Did you also had to add any acpi_backlight= option to the command line?

This is really a bummer, it was working, and I have no idea why it stopped…

Tested 450.80.02, still no backlight control.

enabling brightness control (as an nvidia xorg option) only works on discrete mode which i spend 99% of my time on, im not currently using acpi_backlight parameters.

i’m not sure if it matters but why the " ; " after "EnableBrightnessControl=1"? unless you have other options on the same line you shouldnt need it.

edit: works for me on arch main kernel ‘linux’ and ‘linux-zen’

You’re right, that’s just a leftover from another attempt. Unfortunately removing it doesn’t change anything.

Maybe it’s my kernel config, I’m going to try the arch linux and linux-zen kernels.

No such luck. Which driver version are you using?

Do you also get this error on dmesg? It happens on every boot.

[    1.057696] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.GP17.VGA.LCD._BCM.AFN7], AE_NOT_FOUND (20200717/psargs-330)
[    1.057753] ACPI Error: Aborting method \_SB.PCI0.GP17.VGA.LCD._BCM due to previous error (AE_NOT_FOUND) (20200717/psparse-529)
[    1.057806] ACPI Error: Evaluating _BCM failed (20200717/video-357)

i was on the vulkan beta but im back on 455.45.01 now. i was wrong about acpid because i have it disabled now since it was causing the nvidia gpu to stay on its lowest clock which it wasnt before. even with acpid disabled i still have backlight on discrete mode as long as “EnableBrightnessControl=1” is used. this should show in

/sys/class/backlight/nvidia_0/brightness 

you can see if manual control works

$ echo "50" > /sys/class/backlight/nvidia_0/brightness

nope,

~ >>> dmesg | grep "ACPI Error"                                                                                                                         
[    0.165405] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200717/psobject-220)
[    0.165424] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200717/psobject-220)
[    0.250885] ACPI Error: Aborting method \_SB.PCI0.LPCB.EC0._REG due to previous error (AE_NOT_FOUND) (20200717/psparse-529)

you can try some acpi_osi parameters and see if those errors go away but acpi errors are usually harmless

That’s one thing I don’t have… I have

 /sys/class/backlight/acpi_video0/

And writing any values to brightness or other fields doesn’t do anything…

xorg.1.log does say:

[    10.111] (II) Applying OutputClass "nvidia" options to /dev/dri/card0
[    10.111] (**) NVIDIA(0): Option "RegistryDwords" "EnableBrightnessControl=1"
[    10.112] (**) NVIDIA(0): Enabling 2D acceleration

At a loss here…

Ok it’s solved. This was a horrible saga.

I purged all nvidia drivers, binaries, modules, all configuration files, etc. Rebooted fresh into an environment without any nvidia stuff. Then proceeded to reinstall everything with the 455.45.01 driver.

The backlight control is back and I’m none the wiser… except that from now on I will always make sure I purge all configuration and all drivers etc before I install new ones.

If you’re using Debian or similar OS, here is how to do it. Note that these instructions only apply in the following conditions:

  • You have the laptop in Discrete mode in the BIOS
  • You’re using the Debian packaged nvidia drivers, not the nvidia downloaded ones (which is the way to go if you’re using Debian or similar distros)

On to the instructions.

  1. Purge all configuration and driver packages:
apt --purge remove nvidia*
  1. Reboot into a clean environment with no nvidia stuff

  2. Install the driver version you desire (at the time of writing /experimental will install 455.45.01):

sudo apt install libegl-nvidia0/experimental libgl1-nvidia-glvnd-glx/experimental libglx-nvidia0/experimental libnvidia-eglcore/experimental libnvidia-glcore/experimental libnvidia-ml1/experimental nvidia-alternative/experimental nvidia-driver/experimental nvidia-driver-bin/experimental nvidia-driver-libs/experimental nvidia-egl-common/experimental nvidia-egl-icd/experimental nvidia-kernel-dkms/experimental nvidia-kernel-support/experimental nvidia-modprobe/experimental nvidia-vdpau-driver/experimental xserver-xorg-video-nvidia/experimental libgles-nvidia1/experimental libgles-nvidia2/experimental nvidia-vulkan-icd/experimental libnvidia-cfg1/experimental libcuda1/experimental libnvcuvid1/experimental libnvidia-encode1/experimental nvidia-opencl-icd/experimental nvidia-smi/experimental  libnvidia-cbl/experimental libnvidia-rtcore/experimental nvidia-cuda-mps/experimental libnvidia-ptxjitcompiler1/experimental libnvidia-compiler/experimental libnvidia-glvkspirv/experimental nvidia-settings
  1. Add the brightness control configuration to /etc/X11/xorg.conf.d/21-nvidia-brightness.conf
Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
  1. Reboot again and it should all be working!
1 Like