Skip to contentSkip to conversation

amdgpu reads back brightness 0 (which is not true) if checked before a brightness has been explicitly set

Bug 106228 [email protected] 1 participant 10 messages Apr 25, 2018 – Jul 26, 2018

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=106228

Bug ID: 106228
Summary: amdgpu reads back brightness 0 (which is not true) if
checked before a brightness has been explicitly set
Product: DRI
Version: unspecified
Hardware: Other
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: DRM/AMDgpu
Assignee: [email protected]
Reporter: [email protected]

Created attachment 139091
--> https://bugs.freedesktop.org/attachment.cgi?id=139091&action=edit
The full dmesg

I have tried to install Linux OS on ASUS laptop which is equipped with AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx.

When the Linux installation completed and entered to the OS, the brightness of display looks normal but the brightness bar is shown as the lowest level within the display's brightness GUI setting.

Also check "cat /sys/class/backlight/amdgpu_bl0/brightness" and it is 0.

After a system reboot, Brightness is dimmed to the lowest level. Check "cat /sys/class/backlight/amdgpu_bl0/brightness" again and it is 12.

To make sure it is the problem that "system always reads back brightness 0 if checked before a brightness has been explicitly set".
I disable all of the brightness setting applications, including masking systemd-backlight service and than reboot.
"cat /sys/class/backlight/amdgpu_bl0/brightness" before set brightness manually again and it reads back 0, but the brightness of display looks normal actually. Then, if I drag the brightness bar in GUI, the actual brightness changes and the "/sys/class/backlight/amdgpu_bl0/brightness" goes to the right value. And, I reboot again, then the same things happen again.

I also tried this with kernel v4.17.0-rc2. It still has the same problem.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #1 from Alex Deucher <[email protected]> --- Harry, I thought we fixed something like this recently. Maybe this patch?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c3d7bad88e3b35b981eecc1645ddbb3f13a8b54f

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #2 from Harry Wentland <[email protected]> --- That patch only affects Carrizo and should only be needed for S3.

We don't see this issue with Ubuntu 18.04 on a Raven laptop we have available. The OS (Gnome) shows brightness as expected on boot.

I wonder if some laptops behave differently but I can't think why.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #3 from Daniel Drake <[email protected]> --- Do you have any specific debugging suggestions? Can we ship an affected laptop to you for diagnosis?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #4 from David Francis <[email protected]> --- Created attachment 140795
--> https://bugs.freedesktop.org/attachment.cgi?id=140795&action=edit
Patch that should fix the problem

Could you try out this patch and check if it works? Thanks.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #5 from Daniel Drake <[email protected]> --- Created attachment 140809
--> https://bugs.freedesktop.org/attachment.cgi?id=140809&action=edit
additional patch

this patch may also be required

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #6 from [email protected] ---
Apply "[PATCH] drm/amdgpu: Read back max backlight value at boot" to Linux 4.18.0-rc6 kernel.

I disable all of the brightness setting applications, including masking systemd-backlight service and than reboot.
"cat /sys/class/backlight/amdgpu_bl0/brightness" before set brightness manually again and it reads back 255 (the maximum brightness).

If I unmask systemd-backlight service and than reboot for test, "cat /sys/class/backlight/amdgpu_bl0/brightness" before set brightness manually again and it reads back the brightness which is saved before last reboot.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #7 from [email protected] ---
Applied both "[PATCH] drm/amdgpu: Read back max backlight value at boot" and "[PATCH] drm/amd/display: Implement backlight_ops.get_brightness" to Linux 4.18.0-rc6 kernel.

I got the same behavior as previous comment.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

--- Comment #8 from David Francis <[email protected]> --- When systemd-backlight is disabled, on reboot is the actual brightness coming from the monitor maximum?

If it is, I believe this is working as intended.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=106228

[email protected] changed:

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

         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #9 from [email protected] ---
Hi David,

Yes! It is. Thanks

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel