Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Admin message
The migration is almost done, at least the rest should happen in the background. There are still a few technical difference between the old cluster and the new ones, and they are summarized in this issue. Please pay attention to the TL:DR at the end of the comment.
Enable hybrid graphics/Optimus in BIOS setup, so that the display will be connected to the AMD GPU.
Try to change brightness from GNOME or write into /sys/class/backlight/amdgpu_bl1/brightness. The display brightness doesn't change.
Looking inside /sys/class/backlight/, there is only one directory amdgpu_bl1. max_brightness is 255. actual_brightness follows the value written into brightness.
The amdgpu.backlight=0 kernel parameter mentioned in #1438 (closed) doesn't help here.
acpi_backlight=vendor or acpi_backlight=native or acpi_backlight=none makes no difference. With acpi_backlight=video there is another acpi_video0 in addition to amdgpu_bl1 in /sys/class/backlight/ but neither of them has any effect.
If hybrid graphics is disabled, the display is connected to the Nvidia GPU, the Nvidia proprietary driver can change the display brightness without problem. In this case there is only nvidia_0 in /sys/class/backlight/ with max_brightness 100.
In Windows 10 OS and hybrid graphics mode, the brightness control works if the AMD driver (21.6.1 downloaded from AMD website) is installed and enabled and it doesn't work if the AMD driver is not installed or disabled, regardless of the status of Nvidia driver too.
@agd5f is there any hope of this being something simple or similar to the previous generations issue? Pinging you only because you were one of the people that fixed this the last time.
#1438 (closed) is not asic specific. Does this system have a MUX? Maybe the MUX has switched the backlight to the dGPU? Do you have multiple backlights in /sys/class/backlight/? If so does adjusting any of the other ones help?
Yes, if I add a kernel parameter enabling backlight control for Nvidia it adds an Nvidia backlight (I think it shows up as Nvidia0 or Nvidia1) which is how I was able to control the backlight when I set it to be dGPU only in the BIOS. It works as expected in dGPU only mode, but doesn't do anything in hybrid mode. When in hybrid mode, in xrandr the display shows up as eDP, and when in dGPU only mode it shows up as DP-1 or DP-0. I think the Nvidia card has brightness control over DP-1/DP-0, but not eDP. I don't think it's mux related as this original issue is without a mux switch, everything else is fairly close to the same, and it's having the exact same symptoms. My system has a 5800h and a 30 series card, like this original issue. I also have no idea what I'm talking about.
So there is a MUX. When you boot with the sbios set to dGPU only mode, the MUX (multiplexer - a software controlled switch which changes the routing of a single between multiple devices) switches everything (backlight, displays, etc.) to the dGPU. When you boot in hybrid mode, it's not clear what stuff gets MUXed to which GPU. Presumably the the display on the laptop gets MUXed to the APU, but the backlight is not clear. eDP vs DP-1/DP-0 are just driver labels. There is only one physical panel in the laptop. Some OEMs only use the MUX via the bios (to statically switch between dGPU and APU at boot), others expose the MUX at runtime so drivers can switch it at runtime to optimize gaming on the dGPU dynamically. All of the runtime interfaces for the MUX are vendor specific at this point. You might try using the nouveau driver for the nvidia chip. It may help shed some light on how the MUX is configured.
I'm pretty sure it is exposed somehow with my laptop, as with it having Advanced Optimus on windows, it dynamically switches the mux to the dGPU when a whitelisted application runs, all without a reboot, and I'm fairly sure it's done by the Nvidia driver. Seems like the OP does have a MUX, it just isn't exposed, that being a guess based on the fact that their laptop doesn't support advance Optimus? So just to clarify, with the dGPU only, in /sys/class/backlights the Nvidia one shows up and works correctly, the brightness can be changed. In hybrid mode, both the AMD and NVIDIA backlights show up, and neither of them work.
I tried the nouveau driver. When hybrid mode is enabled in BIOS, there is /sys/class/backlight/amdgpu_bl0/ with the same behavior as the original report.
When hybrid mode is disabled in BIOS (dGPU-only), there is nothing in /sys/class/backlight/ and brightness also can't change. This is different from the Nvidia proprietary driver which would allow brightness control in dGPU-only mode without any special tweaks. But it could be that nouveau just doesn't support the new GPUs very well?
Some screen brightness related entries I noticed in dmesg:
[ 3.328536] ACPI: \_SB_.PCI0.GPP0.PEGP.LCD0: _BCM evaluation failed[ 3.328804] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.GP17.VGA.LCD._BCM.AFN7], AE_NOT_FOUND (20210604/psargs-330)[ 3.328809] ACPI Error: Aborting method \_SB.PCI0.GP17.VGA.LCD._BCM due to previous error (AE_NOT_FOUND) (20210604/psparse-529)[ 3.328826] ACPI: \_SB_.PCI0.GP17.VGA_.LCD_: _BCM evaluation failed
These are only in dGPU-only mode. Same with Nvidia proprietary driver too although brightness actually works. Could this mean in hybrid mode the MUX would route the backlight not to AMD GPU but to some vendor-specific controller that doesn't have a driver in Linux? Then I wonder why in Windows the brightness control would require AMD GPU driver...
This issue is still here with kernel 5.14.16 (Fedora 5.14.16-301.fc35.x86_64).
I can confirm that I also have connection type eDP when it's connected to the AMD GPU but DP-0 when it's connected to Nvidia.
The Dell m15 R5 model comes with several different panel options including some with Advanced Optimus (switching without reboot). But my machine has the 165Hz 1080p panel without Advanced Optimus.
There is no AMD proprietary kernel driver. The packaged drivers on amd.com include the same open source kernel driver as is upstream. The only closed source components are the optional user mode drivers for workstation (e.g., OpenGL).
I also have this problem with nearly identical symptoms (my backlight is named amdgpu_bl0 instead of _bl1). I have a Dell G15 5515 with AMD Ryzen 5800H CPU and Nvidia 3060 GPU, running Arch Linux with 5.15.6 kernel, which includes the OLED eDP brightness control patch. Running with the mux disabled works fine (except for draining the battery faster, of course).
So we know that this is affecting Dell and Lenovo laptops with Ryzen 5000 / NVIDIA 3000 hybrid systems with a MUX. In your searches, have any of you come across anyone with this issue on any other manufacturers devices with the same specs?
It does not affect my Lenovo laptop. I have a Legion 5 Pro 16ACH6H 82JQ (5800h/3060). Brightness control works perfectly in hybrid mode. In discrete graphics mode it started to work from 510.xx drivers. I am currently using 5.16 kernel. It used to work with 5.15 too. Do you experience #1758 ?
Sorry to ping you again @agd5f, just want to make sure you see this -- Is this the correct place for this or is there somewhere else you can think of that it might fit better? Is this likely going to be an issue with the AMDGPU driver, or something else?
I think this is the correct place for the bug. That said, I'm not really sure what the issue is without more insight into the hardware design. amdgpu supports the standard backlight configurations. So it should work assuming this platform uses a standard design. If it doesn't, we'd need to know more about how it's wired up. That fact that these systems use a MUX seems to indicate that there may be some issue with that. There may be some platform specific ACPI controls to switch the backlight MUX to the APU.
If there's a platform specific ACPI control we might be able to find it in an acpidump. Could you share it? That doesn't mean it for sure makes sense for the amdgpu driver to call it directly, but it might be the hint needed to add a new platform driver the amdgpu driver works with.
I would guess the \_SB.PCI0.GPP0.PEGP.LCD0.MXDS or \_SB.PCI0.GPP0.PEGP.LCD0.MXDM methods are the most likely candidates for taking brightness as an argument. You can look at the values in _BCL for things you can put into them.
You might try to interact with them with acpidbg to see if anything happens.
This may be an issue with the Nvidia proprietary driver. According to this post on their forums, Linux is able to adjust the backlight until the Nvidia driver is loaded, at which point neither works.
If the rest of you could confirm that the backlight works properly without the nvidia driver loaded, then we'd know that it's an issue with the nvidia driver.
Without any Nvidia driver (and nouveau as well) the backlight still doesn't work for me. There is still only amdgpu_bl1 in /sys/class/backlight/ which does not change the actual brightness.
The linked post is about a very different issue. In that one, there is a acpi_video0 interface that works and the Nvidia driver would attempt to take over and create a nvidia_0 that doesn't work. Here, the acpi_video0 (enabled via kernel command line options) also does nothing, and Nvidia driver does not create the nvidia_0 interface at all in hybrid mode.
Also in that thread most people are on Intel/Nvidia setup, except for a few reports of Dell G15 and Lenovo Legion whose descriptions are more in line with what we have here instead of the other Intel/Nvidia posts.
I finally got into an arch install, and its all of a sudden working with the NVIDIA proprietary driver, as well as nouveau. My only guess is the 5.16 kernel had something in it that did it? I'm on 5.16.0-arch1-1 which is the stable arch kernel. In /sys/class/backlight I have nvidia_wmi_ec_backlight that i have never seen before, and it is properly functioning, and controlling the backlight. amdgpu_bl0 is still there, but its nonfunctional, sitting at 255 on brightness and actual_brightness and never changing.
It appears that nvidia_wmi_ec_backlight (i.e. on kernels >= 5.16) does indeed solve the brightness control.
However, this only works after putting the system to sleep, and then resuming.
On a clean boot I can only control the brightness using the amdgpu_bl1 controller, via:
echo 50 | sudo tee /sys/class/backlight/amdgpu_bl1/brightness
After resuming from sleep, nvidia_wmi_ec_backlight becomes responsible.
I have detailed my findings here.
I am suspecting a race condition or timing issue.
From the link above, you said that the amdgpu backlight interface works on boot and then after suspend the nvidia backlight control works? It sounds like there is some mux state that the kernel isn't properly handling, so it ends up in whatever state the bios (boot) or default (resume) leaves it in. I would suggest reporting this to the nvidia_wmi_ec_backlight driver maintainers. They probably have a better idea of what is going on.
I am going to assume you already have the nvidia-wmi-ec-backlight module (i.e. you're using a kernel >= 5.16) and that you have read the modifications that this patch addresses (written by Daniel Dadap on the mailing list).
Essentially, there are two things you need to be aware beforehand:
the patch assumes that the iGPU backlight interface is named amdgpu_bl1 (you can verify in /sys/class/backlight)
the patch also address the "backlight level not being restored on boot / resume" quirk.
Daniel introduced a handy quirk table:
+static const struct dmi_system_id quirks_table[] = {+ QUIRK_ENTRY(+ /* This quirk is preset as of firmware revision HACN31WW */+ "LENOVO", "Legion S7 15ACH6",+ QUIRK(RESTORE_LEVEL_ON_RESUME) | QUIRK(PROXY_TO_AMDGPU_BL1)+ ),+ { }+};
So, for my system (Legion S7 15ACH6), this patch addresses both quirks.
Now, what you have to do is to compile a custom nvidia-wmi-ec-backlight.ko kernel module and replace the current one in your modules directory.
NOTE: Make sure to backup the original module.
You can verify its path by using modinfo nvidia_wmi_ec_backlight | grep filename.
Next, you need the original source for the nvidia-wmi-ec-backlight to apply the patch to. You can get the source from here. Again, for convenience, the source (taken from 5.16.14 tree) is attached: nvidia-wmi-ec-backlight.c.
Next, you apply the patch as follows (which will modify the file in-place)
and run make install -- which will compile the kernel module to nvidia-wmi-ec-backlight.ko, compress it using xz, copy it to the appropriate location (replacing the original), then finally regenerate all module dependencies using depmod.
Hi @alexandru-dinu
I have this same issue here. But i dont feel confortble to make this patch by myself.
Do you know if there is any work to upstream this in newer kernel version?
Thanks
It appears that the discussions have stalled. I don't know if there are ongoing plans to merge this upstream, so applying the patch by yourself may be the fastest fix.
Hi, I have Legion 5-15ARH05 with Ryzen 5 4600H and GTX 1650. With amdgpu.backlight=0 kernel parameter everything works perfectly. Here's what happened when I've tried modprobe the module: #1791 (comment 1312639). Do I have to patch the module similiar to #1671 (comment 1320165) or is it possible to include it in quirks for next kernel release or something?