Bug 109375

Summary: Regression: dark notebook display (no backlight) after resume
Product: DRI Reporter: Rafał Miłecki <zajec5>
Component: DRM/AMDgpuAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: alexdeucher, christian.frank.uwb, harry.wentland, nicholas.kazlauskas, sunpeng.li
Version: XOrg git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
drm/amd/display: Detach backlight from stream none

Description Rafał Miłecki 2019-01-16 10:14:33 UTC
I use HP EliteBook 745 G5 with Ryzen 5 PRO 2500U.

Starting with the:
commit 262485a50fd4532a8d71165190adc7a0a19bcc9e (refs/bisect/bad)
Author: Anthony Koo <Anthony.Koo@amd.com>
Date:   Fri Oct 12 21:34:32 2018 -0400

    drm/amd/display: Expand dc to use 16.16 bit backlight
    
    [Why] We want to increase precision for backlight setting.
    But DC interface takes 8 bit backlight level value only.
    
    [How] DMCU already takes 16 bit backlight level.
    Expand the DC interface to take 16.16 bit value.
    Max 32 bit backlight value (0xFFFF) will represent
    max backlight (100%)
    
    Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
    Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
    Acked-by: Leo Li <sunpeng.li@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

After resume from RAM my notebook display is all black.

Before suspend:
> cat /sys/class/backlight/amdgpu_bl0/{actual_brightness,brightness}
65535
255

After resume:
> cat /sys/class/backlight/amdgpu_bl0/{actual_brightness,brightness}
0
255

This can be workarounded by:
echo 255 > /sys/class/backlight/amdgpu_bl0/brightness
assuming one can execute that without a working display.

This problem still exists in the 5.0.0-rc2.
Comment 1 Rafał Miłecki 2019-01-16 10:17:07 UTC
For a comparison: behavior with the commit 262485a50fd4~1 (before the regression):

Before suspend:
> cat /sys/class/backlight/amdgpu_bl0/{actual_brightness,brightness}
255
255

After resume:
> cat /sys/class/backlight/amdgpu_bl0/{actual_brightness,brightness}
250
255

Looks like a problem with amdgpu restoring backlight after resume.
Comment 2 Leo Li 2019-01-16 15:13:26 UTC
Created attachment 143141 [details] [review]
drm/amd/display: Detach backlight from stream

Hi  Rafał,
Please give the attached patch a shot. It's in our staging branch, but not in 5.0-rc2 yet.
Comment 3 Rafał Miłecki 2019-01-16 15:44:55 UTC
It didn't apply cleanly on top of 5.0.0-rc2 (a trivial conflict in the dc_link.c.rej). After fixing that, compiling & testing I can confirm is solves the problem for me! Thanks!

Before suspend:
> cat /sys/class/backlight/amdgpu_bl0/{actual_brightness,brightness}
65535
255

After resume:
> cat /sys/class/backlight/amdgpu_bl0/{actual_brightness,brightness}
64000
255

As it fixes a regression, can you submit it as a fix for the 5.0 release cycle, please?
Comment 5 Alex Deucher 2019-01-21 14:52:30 UTC
*** Bug 109388 has been marked as a duplicate of this bug. ***
Comment 6 Rafał Miłecki 2019-02-04 05:54:50 UTC
Fixed with the 5.0.0-rc3. Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.