From: Mitchell Augustin <[email protected]> Issue: https://gitlab.freedesktop.org/drm/amd/-/work_items/5394 Ubuntu BugLink: https://bugs.launchpad.net/bugs/2162904
I have proposed this patch for inclusion into the Ubuntu kernels. It is really more of a workaround than a root cause fix - but I think a necessary one until the underlying issue is resolved, given how disruptive the failure mode of this bug is for impacted users. I realize that upstream amdgpu may prefer to reject this patch and fix the underlying issue for multimonitor users, but wanted to share what I am proposing here regardless. [ Impact ] On some laptops with a dGPU and an iGPU, the DMCUB's state transition between sleep and wake states on the laptop's built-in panel will (at irregular but frequent intervals, a few times per day in my experience) cause the amdgpu driver to stop working correctly. This will cause varying levels of instability, eventually resulting in the system becoming unusable (described in more detail in the LP bug). Given the intrusiveness of this issue, my proposal is to simply disable the panel self-refresh feature whenever an external display is connected. [ Where problems could occur ] Since disabling panel self-refresh means that the built-in panel will always refresh at its standard refresh rate, users may experience decreased battery life if not connected to power. HOWEVER, given that we only disable it *when an external display is connected*, I expect that the vast majority of laptop users will not be meaningfully impacted. With the possible exception of people using mobile external monitors, I would expect most users who have an external display attached to typically also be connected to power. Additionally, while I have never reproduced this bug when only using my built-in panel (with no external monitor attached), related reports across other distros indicate the underlying bug might still be possible with only the built-in monitor - so this patch may not resolve the bug for 100% of users (but I am confident that it will drastically reduce if not eliminate incidence for configs like mine) [ Test Plan ] Install the patched kernel and do the following: 1) sudo watch -n 0.5 cat /sys/kernel/debug/dri/0000:07:00.0/eDP-2/psr_state # (switch eDP-2 to your built in panel identifier). You should see it switch between "0" and nonzero values when no external display is connected (indicating that PSR is still active and switching to/from sleep state regularly). After connecting an external display, confirm that only 0 is shown even when builtin panel isn't drawing (indicating that PSR has been disabled when the second display is connected). 2) Use your machine normally for 1-2 weeks and confirm that the bug does not reproduce. (It typically reproduces within 1 day, so 1-2 weeks should be a comfortable amount of time here.) Mitchell Augustin (1): Do not enter PSR if multiple displays are active drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.43.0
