Laptop backlight control regression with 465.24.02

Please note the difference, not
EnableBacklightHandler
but
EnableBrightnessControl
just in case…

I’m already force-setting EnableBrightnessControl to true/1 in the X.Org configuration file without any effect, so that won’t help.

However, disabling the backlight handler is still on the table for me.

Finally I got it working thanks to someone answering to my Reddit question:

i915.enable_dpcd_backlight=0 that is the key, do not try it with 1 which does not work and is everywhere quoted… just change it to 0 and enjoy working backlight dimming…

grubby --info=ALL

index=0
kernel=“/boot/vmlinuz-5.15.12-200.fc35.x86_64”
args=“ro rootflags=subvol=root rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 i915.enable_dpcd_backlight=0
root=“UUID=3f93ca69-acd9-4a7d-98f6-f9ae374ead12”
initrd=“/boot/initramfs-5.15.12-200.fc35.x86_64.img”

https://www.reddit.com/r/tuxedocomputers/comments/qmu26c/comment/hqnyd2g/?utm_source=share&utm_medium=web2x&context=3

That probably works only for machines with Intel CPU. I’ll give it a try later, but I have an AMD CPU.

Downgrading, I meant downgrading, of course.

Sadly, it does not. Everything works fine up until loading nvidia-drm (or initializing the card by starting X), afterwards the backlight stays put on 100 %, no matter what value is written to the sysfs node.
The option doesn’t help to tell the driver to back off and let the kernel handle this part. It was worth a shot, though.

I’m glad that this worked for you. But it won’t work for everyone, merely users with hybrid graphic setups where the primary adapter is an Intel one.

Yep, pretty much. It also won’t work for machines where the Nvidia graphics card is hooked up to the display directly, without using a hybrid gmux/indirection through another framebuffer.

So… some of us are still stuck. I just hope that it won’t be a full year until Nvidia actually fixes the issue.

1 Like

Sidenote, EnableBacklightHandler is not a RegistryDword but an own setting, so the correct kernel parameter would be

nvidia.NVreg_EnableBacklightHandler=0

or as modeprobe config
options nvidia NVreg_EnableBacklightHandler=0

At least this setting is also in the manual.

That’s exactly what I’ve written in this post.

There used to be such an option to the nvidia module, and it’s still documented as such, but the option was removed a while ago without modifying the documentation. Passing it will just do nothing now, other than issue a warning about an unknown option.

Due to this, I reimplemented the option local to nvidia-modeset (which registers the custom backlight handler) and stubbed out the functions if 0 is passed, which lead to no nvidia backlight node being created, but didn’t change the fact that changing the brightness of the apci_video0 node doesn’t have any effect either.

2 Likes

I had been having this problem as well, and upgrading the kernel to 5.16 (on Arch Linux) with the Nvidia 495.46 driver has resolved the problem for me.

2 Likes

Just updated the kernel? Or did you make some other changes to the Xorg file? More details, please.
And what kernel are you using, ZEN?

I just updated the kernel and the nvidia package (as it is required to match the kernel version). I have no Xorg configuration files, it is all auto-detected. I am using the stock linux kernel package on Arch, no ZEN.

can you please elaborate what system you have and if you’re sure the nvidia driver is in use.
I’ve installed the latest kernel (5.16.1-051601-generic) using mainline application together with the latest nvidia beta driver (510.39.01) and there is still no backlight control.

I’m using xubuntu 21.10
inxi -SGc
System: Host: lenovo Kernel: 5.16.1-051601-generic x86_64 bits: 64 Desktop: Xfce 4.16.0 Distro: Ubuntu 21.10 (Impish Indri)
Graphics: Device-1: NVIDIA TU117GLM [Quadro T2000 Mobile / Max-Q] driver: nvidia v: 510.39.01
Device-2: IMC Networks Integrated Camera type: USB driver: uvcvideo
Display: x11 server: X.Org 1.20.13 driver: loaded: nvidia resolution: 3840x2160~60Hz
OpenGL: renderer: Quadro T2000/PCIe/SSE2 v: 4.6.0 NVIDIA 510.39.01

The nvidia driver (460.91.03) and the xubuntu supplied nouveau driver are the only drivers supporting backlight control.

I’m using Arch Linux, with kernel 5.16.1 using the Nvidia 495.46 drivers. Nouveau is not installed on my system.

Do you have a nvidia_wmi_ec_backlight module loaded? That seems to be the key to getting it to work for the new kernel.

the module “nvidia_wmi_ec_backlight” was not loaded, but after configure the module in “/etc/modules” and reboot, i see that the module is loaded by using “lsmod” but still no backlight control. Do i have to configure something else ?

The nvidia_wmi_ec_backlight module (previously called wmaa-backlight-wmi on older kernel versions) is only useful for users with hybrid graphics (at least that’s what the module help text suggests).

Curiously, the Lenovo P17 Gen 1 seems to support hybrid setups, so you might be in luck. Try changing the mode in the UEFI settings: press F1 while booting up, go to Config > Display > Graphic Devices and switch the mode to Hybrid if it’s set to Discrete.

This might change the mux to switch to the Intel graphics card as the primary framebuffer device and make things like the nvidia_wmi_ec_backlight module work.

Looks like non-hybrid, purely discrete graphics users are still out of luck. I will probably try 510.39.01 at a later time, but don’t have too much hope.

I am using a Legion 5 Pro, came with AMD + Nvidia GPU.

Tried loading module as suggested and use discrete GPU with no luck

$ lsmod | grep nvidia
nvidia_wmi_ec_backlight    16384  0
nvidia_uvm           2576384  0
nvidia_drm             73728  7
nvidia_modeset       1155072  18 nvidia_drm
nvidia              36974592  1002 nvidia_uvm,nvidia_modeset
wmi                    40960  3 nvidia_wmi_ec_backlight,wmi_bmof,ideapad_laptop

This is packages I installed

pacman -Qm | grep nvidia
lib32-nvidia-utils-tkg 495.46-195
lib32-opencl-nvidia-tkg 495.46-195
nvidia-egl-wayland-tkg 495.46-195
nvidia-settings-tkg 495.46-195
nvidia-tkg 495.46-195
nvidia-utils-tkg 495.46-195
opencl-nvidia-tkg 495.46-195

P/S: I am typing this with full brightness and having headache which probably will make me sick for the next few hours. Downgrading nvidia…

see post #28 how to change the brightness if backlight control is not working, that’s what I’m using currently to lower the screen brightness.

use “xrandr” to see what output is connected.

I can confirm that this backlight brightness bug has been fixed at long last with the latest beta driver 510.39.01. Tested on up-to-date Arch Linux with beta driver 510.39.01 from AUR repository on Lenovo Legion 5 Pro 16ACH6H (AMD) laptop with RTX 3070 card in discrete mode, of course.
There was no need for any module parameters. The only bug remaining is that the backlight does not get restored at new boot, so a custom systemd unit and a local script are still needed.
The fix below has also been successully tested on the same machine, running Debian GNU/Linux 11 (bullseye) which comes with 460.91.03 (unaffected) version of NVIDIA driver. The only difference is that the custom script “save-nvidia-brightness.sh” was saved to /etc/init.d folder which is present on said Debian release.

sudo nano /usr/local/bin/save-nvidia-brightness.sh

#!/bin/bash
# Saves nvidia brightness settings on reboot/shutdown
cat /sys/class/backlight/nvidia_0/actual_brightness | /usr/lib/systemd/systemd-backlight save backlight:nvidia_0

sudo chmod +x /usr/local/bin/save-nvidia-brightness.sh

sudo nano /lib/systemd/system/save-nvidia-brightness.service

[Unit]
Description=Save nvidia brightness
DefaultDependencies=no
Before=shutdown.target reboot.target halt.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/save-nvidia-brightness.sh

[Install]
WantedBy=halt.target reboot.target shutdown.target

systemctl enable save-nvidia-brightness

After adjusting brightness level to your liking, check by rebooting your machine and verifing that the brightness level has been restored.

Reference:
http://dalvikplanet.blogspot.com/2019/08/save-current-screen-brightness-before.html

Thank you! I am using the very same laptop and can confirm 510.39.01 fixed this issue. EnableBrightnessControl=1 is not needed as well.

I got a solution for my device: Putting i915 into /etc/initramfs-tools/modules and run sudo update-initramfs -u fixes the issue.

Ubuntu only ofc. But other distros should have similar ways to add a module to initramfs for early kms.

Found an alernative maybe better solution for my situation:

Create a file /etc/modprobe.d/random-name-here.conf with content:

softdep nvidia pre: i915

Making sure that the intel driver gets initialized before the nvidia driver. (Also establishes a dependency relation as a sideeffect so should not be set on amd devices)