[Bug 1180749] New: AMD Ryzen 4800H Integrated Graphics brightness control not working as found in some Lenovo Legion 5 15ARH05
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749 Bug ID: 1180749 Summary: AMD Ryzen 4800H Integrated Graphics brightness control not working as found in some Lenovo Legion 5 15ARH05 Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: openSUSE Tumbleweed Status: NEW Severity: Normal Priority: P5 - None Component: Kernel Assignee: kernel-bugs@opensuse.org Reporter: antonyjr000@gmail.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- When using switchable graphics in Lenovo Legion 5 15ARH05, the AMD Renoir APU works along with NVIDIA Graphics(even non-free and prime works) but the brightness cannot be controlled by the Fn keys, Software or /sys/class/backlight I've tried setting all the kernel params like acpi_backlight=vender or native but the brightness control still does not work. I highly suspect it's a bug in the amdgpu kernel driver. For now nvidia graphics card works with brightness control. It is also worthy to note that cat /sys/class/backlight/*/actual_brightness always returns 311 and does not change even when executed echo 50 > /sys/class/backlight/*/brightness There are number of reports on this issue over the internet but nothing official. I've tried a lot of linux distros and none of them work and it seems it is broken even in the mainline kernel. I've also tried Kernel:HEAD version of the kernel without the nvidia graphics support but still the brightness control does not work. At the time writing I've booted linux 5.11-rc2 but the brightness control still does not work. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
Antony J.R
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c2
--- Comment #2 from Antony J.R
Care to report to the upstream, e.g. gitlab.freedsktop.org Issues? That's the official place for reporting. I'll keep this bug opened in case we can do some backports based on the upstream devs.
I thought this is a bug with the amdgpu and radeon drivers in the linux kernel, is it not the case?? So it is a X.Org thing? I'm a bit confused here. But I will try to talk with freedesktop folks. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c3
--- Comment #3 from Antony J.R
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c4
--- Comment #4 from Takashi Iwai
(In reply to Takashi Iwai from comment #1)
Care to report to the upstream, e.g. gitlab.freedsktop.org Issues? That's the official place for reporting. I'll keep this bug opened in case we can do some backports based on the upstream devs.
I thought this is a bug with the amdgpu and radeon drivers in the linux kernel, is it not the case?? So it is a X.Org thing?
gitlab.freedesktop.org also the place where the kernel graphics guys use as the primary development place in general. Use DRI/AMDGPU or such component there. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c5
--- Comment #5 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c6
--- Comment #6 from Antony J.R
Actually, which backlight drivers are being used there? Is it only ACPI or native driver?
And do I understand correctly that, if you switch to Nvidia driver (both mod setting and rendering), the backlight control works via /sys/class/backlight, while the same doesn't work if switching to AMDGPU?
To be exact, hybrid graphics brightness control does not work. Yes using only the discrete graphics card with nvidia non-free software enables me to control the backlight. But when switched to hybrid graphics(switchable graphics) the iGPU brightness control will not work. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c7
--- Comment #7 from Antony J.R
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c8
--- Comment #8 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c9
--- Comment #9 from Antony J.R
OK, then this sounds like a bug in amdgpu, indeed. If so, gitlab.freedesktop.org is the right place to report. Please go ahead :)
Okay I've reported it to the upstream -> https://gitlab.freedesktop.org/drm/amd/-/issues/1438 -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c10
--- Comment #10 from Antony J.R
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c11
--- Comment #11 from Antony J.R
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c12
--- Comment #12 from Takashi Iwai
Kernel bug https://bugzilla.kernel.org/show_bug.cgi?id=203905
I'm afraid that the above is a bit different issue. The fix for the scaling problem was already included in 5.9 kernel. We need starting the debug locally, at least to see what values are floating around there. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c13
Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c14
--- Comment #14 from Antony J.R
I'm building an amdgpu KMP with a debug print patch, targeted for Tumbleweed kernel. Could you try the amdgpu-dbg-kmp-default from OBS home:tiwai:bsc1180749 repo, and give the dmesg output?
Okay I've installed your package and rebooted with switchable graphics enabled, all the required logs are uploaded here -> https://github.com/antony-jr/lenovo-legion5-15arh05-scripts/tree/main/AMDGPU... Also here is a very similar kernel bug -> https://bugzilla.kernel.org/show_bug.cgi?id=207833 -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c15
--- Comment #15 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c16
--- Comment #16 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c17
--- Comment #17 from Antony J.R
Hm there is no added debug message. Could you rebuild initrd (e.g. run mkinitrd) and retest?
mkinitrd did the trick but now sddm does not start automatically for some reason so I have to do startx from tty but I can rollback. The updated log is in the same location -> https://github.com/antony-jr/lenovo-legion5-15arh05-scripts/blob/main/AMDGPU... For more debug info I tried to decrease the brightness to 0% and go to 100% again, hope that helps. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c18
--- Comment #18 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c19
--- Comment #19 from Antony J.R
Thanks. It shows that aux is used for the backlight control, and the values set there look OK through a quick glance. While you tested the brightness, it didn't change actually, right?
Could you try to read the current brightness, and check the kernel log, too?
Sorry for the late reply, the updated log is here => https://github.com/antony-jr/lenovo-legion5-15arh05-scripts/blob/main/AMDGPU... I changed the brightness and did cat /sys/class/backlight/amdgpu_bl1/brightness and /sys/class/backlight/amdgpu_bl1/actual_brightness Here the brightness changed when changed the brightness but actual_brightness is stuck at 311 constantly. The kernel log also shows that the get brightness routine output is stuck at invalid values. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c20
--- Comment #20 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c21
--- Comment #21 from Antony J.R
Thanks. Then I misunderstood situation as if the backlight control didn't take any effect.
I mean the backlight is constantly at maximum brightness and I can't decrease or control it. The only thing works is the brightness slider in OpenSUSE and the brightness value is only reflected in /sys/class/backlight/amdgpu_bl0/brightness file but the backlight does not change at all. I think I misled you saying "Here the brightness changed when changed the brightness but actual_brightness is stuck at 311 constantly.", Here I said /sys/class/backlight/amdgpu_bl0/brightness changes when I change the brightness slider in the OS (or Fn Keys) but the backlight still remains at maximum brightness.
Now I refreshed the OBS KMP repo to contain the possible fix. It's being rebuilt, and please give it a try later. The rpm changelog should contain the entry like: - Add a proper fix (attempt): 0001-drm-amd-display-Fix-the-brightness-read-via-aux.patch
At first, uninstall the previous KMP, just do "zypper rm amdgpu-dbg-kmp-default" Then re-install the new rpm, run mkinitrd and retest. This doesn't contain the debug prints, so report back whether it works or not.
I will report back ASAP. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c22
--- Comment #22 from Antony J.R
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c23
--- Comment #23 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c24
--- Comment #24 from Antony J.R
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c25
--- Comment #25 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c26
--- Comment #26 from Antony J.R
OK, then you're hitting multiple issues, as it seems.
The inconsistent value read from sysfs was addressed by my patch. But, I suppose that the main reason of the non-functional backlight is that the driver misdetected the backlight control over aux.
I refreshed again the KMP with a hack patch to disable the aux support. Please give it a try later again. This will show a line "XXX ext_caps=0x..." in kernel log.
IT WORKED!!!! Thank you for your time. I can now control the brightness with Fn Keys or the OS Slider in OpenSUSE. So the problem was with the aux detection. I know this is not a proper fix but it works. I hope you upstream this work to the mainline kernel or OpenSUSE patches?? -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c27
--- Comment #27 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c28
--- Comment #28 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c29
--- Comment #29 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c30
--- Comment #30 from Antony J.R
OK, finally got some good news.
I'm rebuilding the KMP again with a patch to add a module option "aux_backlight" instead of blindly disabling the aux backlight. So keep your working KMP for now, and check later the new KMP and test with amdgpu.aux_backlight=0 boot option. This is no solution but an acceptable workaround, I suppose.
I'm going to submit two patches to upstream.
Yes it's okay but the official kernel maintainer and openSUSE is not going to accept this patch so I can see that the official support is very far away :P
Oh, BTW, which value was shown in the "XXX ext_caps=..." line?
[ 7.872674] amdgpu: XXX ext_caps=0xa7 -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c32
--- Comment #32 from Antony J.R
Alex submitted the patches including my module parameter patch to the upstream amd-gfx ML, and now I updated amdgpu-dbg KMP based on those patches. (And the debug print was dropped.)
Could you check it later together with the latest (matching) TW kernel? Once after confirming it works for you, I'll merge those patches to TW kernel.
Even after merging TW, though, we'll still need to keep the upstream bug opened until more workarounds are implemented (e.g. DMI-based quirk entries).
Many thanks. With the kernel param amdgpu.backlight=0 the backlight brightness control works with the latest TW kernel and your package at the time of writing. I wonder if we can get connected with any Lenovo or ASUS folks to find out what they did wrong? But I guess that's not gonna happen. Do they contribute anything open source in the first place?? Only time will tell :) -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c33
Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c41
P
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c42
--- Comment #42 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749
http://bugzilla.opensuse.org/show_bug.cgi?id=1180749#c45
--- Comment #45 from Antony J.R
The amdgpu.backlight module option was already merged in the upstream, so TW should have a workaround (passing amdgpu.backlight=0 boot option). This was also already merged in SLE15-SP3 / Leap 15.3 kernel, too. But I don't think we'd fix this for Leap 15.2.
The root cause of the problem hasn't been figured out yet. My bet is that it's a BIOS bug, and more proper workarounds are needed in AMDGPU driver side, but this has to be sorted out in the upstream development. Feel free to join to the upstream gitlab Issues.
It seems that without the amdgpu.backlight=0 kernel parameter the brightness control is working in hybrid mode. I don't know what fixed it maybe this https://gitlab.freedesktop.org/agd5f/linux/-/commit/f2ad3accefc63e72e9932e14... commit. But the brightness control seems to work good now in Linux 5.14.14 in TW. -- You are receiving this mail because: You are the assignee for the bug.
participants (1)
-
bugzilla_noreply@suse.com