Skip to contentSkip to conversation

New: amdgpu:actual_brightness has unreal/wrong value

Bug 203905 [email protected] 1 participant 34 messages Jun 15, 2019 – May 6, 2021

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=203905

            Bug ID: 203905
           Summary: amdgpu:actual_brightness has unreal/wrong value
           Product: Drivers
           Version: 2.5
    Kernel Version: 5.1.9
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Video(DRI - non Intel)
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

Radeon R5/R6/R7 Graphics in a Thinkpad A275 has wrong values on actual_brightness of amdgpu_bl0. While max_brightness is 255 and it can be set to 255, actual_brightness reports a 5 digit number like 12470. As a result, tools which want to change the brightness related to actual_brightness fail, as brightness does not accept any 5 digit number,

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #1 from Michel Dänzer ([email protected]) --- Please attach the output of dmesg.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #2 from Bjoern Franke ([email protected]) --- Created attachment 283299
--> https://bugzilla.kernel.org/attachment.cgi?id=283299&action=edit
dmesg

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #3 from Lukáš Krejčí ([email protected]) ---
Commit 262485a50fd4 ("drm/amd/display: Expand dc to use 16.16 bit backlight") changed the value that is returned for actual_brightness:

-static unsigned int dce_abm_get_current_backlight_8_bit(struct abm *abm) +static unsigned int dce_abm_get_current_backlight(struct abm *abm)

 {
    struct dce_abm *abm_dce = TO_DCE_ABM(abm);
    unsigned int backlight = REG_READ(BL1_PWM_CURRENT_ABM_LEVEL);

- return (backlight >> 8);
+ /* return backlight in hardware format which is unsigned 17 bits, with
+ * 1 bit integer and 16 bit fractional
+ */
+ return backlight;
}

I could not find anything official about the range of actual_brightness, only the following blog says that is has to be in range of brightness:
https://nikula.org/~jani/backlight/#index3h3

I guess amdgpu_dm_backlight_get_brightness() could be changed to bring the actual_brightness value in range of brightness again since it returns the value of brightness in the error path anyway.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Sandor Ecker ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #4 from Sandor Ecker ([email protected]) --- Hi,

I have the same Issue.

I have written a bug report to this:

https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-amdgpu/+bug/1861925

Maybe that is not the correct place...

Is any news regarding the problem?

Thx,
Regards,
Sandor

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #5 from Sandor Ecker ([email protected]) --- Would it be possible to set max_brightness to 2^16-1 ?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #6 from Sandor Ecker ([email protected]) ---
So it seems that the 16 bit actual_brightness is not a bug, but a feature... :)

https://github.com/torvalds/linux/commit/262485a50fd4532a8d71165190adc7a0a19bcc9e#diff-b496037255b7766a782d3f3711b50db8

So my question now:
-why are the max_brightness and brightness values in 8bit range?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #7 from Sandor Ecker ([email protected]) --- I have upgraded to 5.6.rc1:

uname -a
Linux Aspire-A315-41 5.6.0-050600rc1-generic #202002092032 SMP Mon Feb 10 01:36:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I have seen that the code has log messages like:

DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n",

                        backlight_pwm_u16_16, backlight_pwm_u16_16);

I have set the kernel log by

echo "8" > /proc/sys/kernel/printk
cat /proc/sys/kernel/printk
8 4 1 7

but I can't see any logmessage with "New Backlight" in the output of the commands:

grep -i "new backli" /var/log/*
dmesg |grep -i "back"

Maybe it does not reach that line of code? Or the log should be visible somewhere else... ?

Can somebody help...?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Flo Bock ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #8 from Flo Bock ([email protected]) ---
With recent systemd changes, the 16 bit values in actual_brightness break saving and restoring the backlight values using AMDGPU. According to a closed issue on Github, Lennart Poettering sees this as a kernel issue[1]. Is there any good reason for actual_brightness to be 16bit, whereas both max_brightness and brightness are 8bit?

[1]: https://github.com/systemd/systemd/issues/16600

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Kunal Bhat ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #9 from Kunal Bhat ([email protected]) --- (In reply to Flo Bock from comment #8)

Quoted 7 lines

With recent systemd changes, the 16 bit values in actual_brightness break saving and restoring the backlight values using AMDGPU. According to a closed issue on Github, Lennart Poettering sees this as a kernel issue[1]. Is there any good reason for actual_brightness to be 16bit, whereas both max_brightness and brightness are 8bit?

[1]: https://github.com/systemd/systemd/issues/16600

I believe it's there to provide a higher range of precision for the backlight. Not sure why they never extended the range for max_brightness.

The systemd devs are adamant that this is a driver issue, and aren't ready to implement a work around for it.
I believe this is the open issue with the discussions right now:
https://github.com/systemd/systemd/issues/16630

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #10 from Alexander Monakov ([email protected]) --- Proposed patch:
https://lore.kernel.org/lkml/[email protected]/

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#11 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #11 from Alexander Monakov ([email protected]) --- v2 patch:
https://lore.kernel.org/lkml/[email protected]/

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

rugk ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #12 from rugk ([email protected]) --- (Backlink only) Same issue reported on
https://discussion.fedoraproject.org/t/amd-amdgpu-bl0-backlight-not-restored/20445?u=rugk

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

[email protected] ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #13 from [email protected] ([email protected]) --- I have built a workaround for this issue by forking systemd-backlight for the time-being. It has been tested on my ASUS TUF FX505DT with Ryzen 3550H.

https://github.com/shanmukhateja/systemd/tree/fix-amdgpu-backlight

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#14 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #14 from Xia Mu ([email protected]) ---
The bug should be fixed in 5.9.0-0.rc3. I tested it on my laptop with AMD Ryzen 7 PRO 4750U CPU with Renoir GPU.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#15 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

John Shand ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #15 from John Shand ([email protected]) ---
i have had this problem as well. was recently working well with kernel 5.8.7. i then install ucode-amd and then grub-mkconfig -o /boot/grub/grub.cfg to set the changes. grub automatically made the new code image work with initramfs and then, backlight went back to about 20% or 255.

would this have anything to do with amd's ucode image??

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#16 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #16 from John Shand ([email protected]) --- Created attachment 292417
--> https://bugzilla.kernel.org/attachment.cgi?id=292417&action=edit
Dmesg 8-9-2020

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#17 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #17 from John Shand ([email protected]) --- Created attachment 292419
--> https://bugzilla.kernel.org/attachment.cgi?id=292419&action=edit
Journalctl 8-9-2020

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#18 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Germán Ríos González ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |german.rios.gonzalez@gmail.
                   |                            |com

--- Comment #18 from Germán Ríos González ([email protected]) --- (In reply to Xia Mu from comment #14)

Quoted 2 lines

The bug should be fixed in 5.9.0-0.rc3. I tested it on my laptop with AMD Ryzen 7 PRO 4750U CPU with Renoir GPU.

I'm actually using 5.9.9-200.fc33.x86_64 and the problem it's still there

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#19 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #19 from [email protected] ---
I confirm that the bug is not fixed in 5.9.12.

https://github.com/systemd/systemd/issues/17826

As Poettering pointed out, actual_brightness is read-only and reports the brightness currently in effect, while brightness is writable and reports the value set by userspace.

Not only the actual brightness is in a different range that breaks systemd backlight restoring service at startup, but on my device its value is also fixed on the same value while it should reflect the correct level on brightness changes.

Brightness at the maximum:
/sys/class/backlight/amdgpu_bl0/actual_brightness > 249 /sys/class/backlight/amdgpu_bl0/brightness > 255 /sys/class/backlight/amdgpu_bl0/max_brightness > 255

Brightness at the minimum:
/sys/class/backlight/amdgpu_bl0/actual_brightness > 249 /sys/class/backlight/amdgpu_bl0/brightness > 2 /sys/class/backlight/amdgpu_bl0/max_brightness > 255

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#20 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Antony J.R ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #20 from Antony J.R ([email protected]) ---
I can confirm that the bug is still not fixed even in 5.11-rc6 (the latest kernel at the time of writing).

I can't control brightness also.

I have a AMD Ryzen 7 4800H APU which has Renoir Graphics.

The brightness control only works with Fedora Workstation 32 with Linux Kernel 5.6.6 but with 5.11-rc6 brightness control does not work at all.

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#21 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Paulo Nascimento ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #21 from Paulo Nascimento ([email protected]) --- I confirm that the bug is not fixed in kenel 5.11-rc3

max brightness:
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/actual_brightness 311
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/brightness 255
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/max_brightness 255

min brightness:
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/actual_brightness 311
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/brightness 0
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/max_brightness 255

My laptop has an amd ryzen 5 4600h with renoir igpu and nvidia dgpu. Tests are done with renoir igpu:

[pn@pn-legion backlight]$ inxi -G
Graphics: Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] driver: nouveau
v: kernel
Device-2: Advanced Micro Devices [AMD/ATI] Renoir driver: amdgpu v:
kernel
Device-3: Chicony Integrated Camera type: USB driver: uvcvideo
Display: x11 server: X.Org 1.20.10 driver: loaded:
amdgpu,ati,modesetting,nouveau resolution: 1920x1080~120Hz

           OpenGL: renderer: AMD RENOIR (DRM 3.40.0 5.11.0-1-MANJARO LLVM

11.0.1) v: 4.6 Mesa 20.3.3

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#22 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #22 from Antony J.R ([email protected]) --- A workaround for this is done by the OpenSUSE folks, Please see
https://bugzilla.opensuse.org/show_bug.cgi?id=1180749

The only distro which fixes this is OpenSUSE. This is because there is a bug in the mainline kernel and kernel devs are not responding to us for some reason(maybe file a new issue???).

The problem is that the kernel uses aux for backlight control but our systems don't support backlight control via aux. So disabling aux completely from amdgpu kernel module can give us backlight control for the iGPU. I've tested it and it works just find.

Regards,
Antony J.R

Quoted 54 lines · On Mon, Feb 8, 2021 at 3:47 AM <[email protected]> wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Paulo Nascimento ([email protected]) changed:

What |Removed |Added

----------------------------------------------------------------------------
CC| |
[email protected]

--- Comment #21 from Paulo Nascimento ([email protected]) --- I confirm that the bug is not fixed in kenel 5.11-rc3

max brightness:
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/actual_brightness
311
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/brightness 255
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/max_brightness
255

min brightness:
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/actual_brightness
311
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/brightness 0
[pn@pn-legion backlight]$ cat /sys/class/backlight/amdgpu_bl1/max_brightness
255

My laptop has an amd ryzen 5 4600h with renoir igpu and nvidia dgpu. Tests are done with renoir igpu:

[pn@pn-legion backlight]$ inxi -G
Graphics: Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] driver:
nouveau
v: kernel
Device-2: Advanced Micro Devices [AMD/ATI] Renoir driver:
amdgpu v:
kernel
Device-3: Chicony Integrated Camera type: USB driver: uvcvideo
Display: x11 server: X.Org 1.20.10 driver: loaded:
amdgpu,ati,modesetting,nouveau resolution: 1920x1080~120Hz

           OpenGL: renderer: AMD RENOIR (DRM 3.40.0 5.11.0-1-MANJARO LLVM

11.0.1) v: 4.6 Mesa 20.3.3

--
You may reply to this email to add a comment.

You are receiving this mail because:
You are on the CC list for the bug.

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#23 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #23 from [email protected] ---
There's a workaround here

I hope it helps :)

simply write this into /etc/systemd/system/backlight-fix.service:

```
[Unit]
Description=Dummy service for attempting to start the problematic amdgpu_bl0
service

[Service]
Type=simple
ExecStart=systemctl start systemd-backlight@backlight:amdgpu_bl0

[Install]
WantedBy=multi-user.target
```

And then sudo systemctl enable --now backlight-fix.service

Bingo!!

The problem is gone

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#24 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #24 from [email protected] ---
Related to the previous post:

https://www.linux.org/threads/failed-to-start-load-save-screen-backlight-brightness-of-amdgpu_bl1.31998/#post-113058

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#25 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #25 from [email protected] ---
I found another workaround and it's easier than EVER and it's done via mkinitcpio😁

First, what's mkinitcpio(https://wiki.archlinux.org/index.php/Mkinitcpio)?

The initial ramdisk is in essence a very small environment (early userspace) which loads various kernel modules and sets up necessary things before handing over control to init. This makes it possible to have, for example, encrypted root file systems and root file systems on a software RAID array. mkinitcpio allows for easy extension with custom hooks, has autodetection at runtime, and many other features.

So go ahead and edit with sudo nano /etc/mkinitcpio.conf

Then add the "amdgpu" in the modules section like this:

MODULES=(amdgpu)

After that, simply run sudo mkinitcpio -P so that it regenerates mkinitcpio for all kernels

This solved my issue, I hope it works for others too :)_

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#26 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #26 from Paulo Nascimento ([email protected]) ---
laptop: Lenovo Legion 5, amd ryzen 5 4600h
Graphics: Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] driver: nouveau
Device-2: Advanced Micro Devices [AMD/ATI] Renoir driver: amdgpu
Kernel 5.11.6-1
Manjaro 21.1

I have tried all suggested workarounds:
- systemctl start systemd-backlight@backlight:amdgpu_bl0

- mkinitcpio with MODULES=(amdgpu)

- acpi_backlight=vendor

- acpi_backlight=video

- /usr/lib/systemd/systemd-backlight save backlight:amdgpu_bl0 /usr/lib/systemd/systemd-backlight load backlight:amdgpu_bl0

Even echo 10 >/sys/class/backlight/amdgpu_bl0/brightness doesn't change the brightness.

Any suggestions?

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#27 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #27 from [email protected] ---
For me the only workaround to avoid this bug is disabling systemd backlight restoration. Then use brillo and enable a specific service to restore the brightness at startup.

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#28 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #28 from Antony J.R ([email protected]) --- (In reply to Paulo Nascimento from comment #26)

Quoted 16 lines

laptop: Lenovo Legion 5, amd ryzen 5 4600h
Graphics: Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] driver:
nouveau
Device-2: Advanced Micro Devices [AMD/ATI] Renoir driver: amdgpu
Kernel 5.11.6-1
Manjaro 21.1

I have tried all suggested workarounds:
- systemctl start systemd-backlight@backlight:amdgpu_bl0

- mkinitcpio with MODULES=(amdgpu)

- acpi_backlight=vendor

- acpi_backlight=video

Quoted 7 lines

- /usr/lib/systemd/systemd-backlight save backlight:amdgpu_bl0 /usr/lib/systemd/systemd-backlight load backlight:amdgpu_bl0

Even echo 10 >/sys/class/backlight/amdgpu_bl0/brightness doesn't change the brightness.

Any suggestions?

Please read the entire thread here ->
https://bugzilla.opensuse.org/show_bug.cgi?id=1180749

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#29 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

Filip Hejsek ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #29 from Filip Hejsek ([email protected]) --- All the workarounds posted here are for a different bug:
https://bugzilla.kernel.org/show_bug.cgi?id=210263

There are three different problems:
- setting brightness doesn't work before showing something on display (the bug linked above)
- actual_brightness has wrong range (this bug)
- kernel uses aux for backlight control on systems that don't support it

For the third problem, there is a patch in
https://bugzilla.opensuse.org/show_bug.cgi?id=1180749, and it seems to be merged already. However, because there is no way yet to detect that aux backlight doesn't work, the workaround has to be enabled with amdgpu.aux_backlight=0 (assuming you have a kernel with the patch).

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#30 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #30 from Paulo Nascimento ([email protected]) ---
laptop: Lenovo Legion 5, amd ryzen 5 4600h
Graphics: Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] driver: nouveau
Device-2: Advanced Micro Devices [AMD/ATI] Renoir driver: amdgpu
Kernel: 5.12.0-1-MANJARO x86_64

I have loaded kernel 5.12 and enabled the patch with amdgpu.backlight=0. The brightness controls Fn+F5/F6 works as well as the controls in KDE panel.

There are still the error messages at boot and shutdown though.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#31 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #31 from Paulo Nascimento ([email protected]) --- Error messages are:
Mai 03 23:01:37 pn-legion systemd-backlight[861]: Failed to get backlight or LED device 'backlight:acpi_video1': No such device
Mai 03 23:01:37 pn-legion systemd-backlight[862]: amdgpu_bl1: Failed to write system 'brightness' attribute: No such device or address
Mai 03 23:01:37 pn-legion systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:acpi_video1.

I think it has to do with the NVIDIA device.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#32 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #32 from Filip Hejsek ([email protected]) ---
The acpi_video error seems to be
https://github.com/systemd/systemd/issues/15329 - first the ACPI driver creates acpi_video1 device, then amdgpu removes it in favor of amdgpu_bl1, but systemd still tries to set brightness on the removed device (which fails). You can remove the error by masking systemd-backlight@backlight:acpi_video1.service.

The amdgpu_bl1 error is probably the bug i linked earlier -
https://bugzilla.kernel.org/show_bug.cgi?id=210263. Do you have silent boot? If yes, you need to print something to console before setting backlight during boot. You can use the workaround i posted here:
https://bbs.archlinux.org/viewtopic.php?pid=1971198#p1971198. If you use my workaround, make sure to remove other workarounds you may have applied for that error (like another service that runs systemctl start systemd-backlight@backlight:amdgpu_bl0).

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#33 lore raw

[Bug 203905] amdgpu:actual_brightness has unreal/wrong value

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=203905

--- Comment #33 from Filip Hejsek ([email protected]) --- Forgot to mention: since your AMD GPU has number 1 (not 0), you need to replace acpi_video0 with acpi_video1 in my workaround.

(To others: sorry for the email spam)

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.