Skip to contentSkip to conversation

drm/amdgpu: Do not enter PSR if multiple displays are active

PATCH In review [email protected] 2 participants 7 messages Aug 7 – Aug 11

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover drm/amdgpu: Do not enter PSR if multiple displays are active

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(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 drm/amdgpu: Do not enter PSR if multiple displays are active

From: Mitchell Augustin <[email protected]>

Issue: https://gitlab.freedesktop.org/drm/amd/-/work_items/5394
Ubuntu BugLink: https://bugs.launchpad.net/bugs/2162904

This commit disables panel self-refresh when more than one display is active to eliminate a common hang and system crash that happens frequently on some laptops, evidently due to race conditions between the DMCUB, amdgpu module, and possibly other components which are exacerbated when more than one display is active.

To my knowledge, a fix for the underlying failure condition is not available upstream, so given how disruptive this is for impacted users, I propose disabling this feature under this condition until it is fixed. The main downside of disabling PSR is that it
will increase power consumption, but this should be barely noticeable to end users, since PSR will remain enabled on laptops unconnected to external monitors, and since laptops connected to external monitors are likely typically also connected to power (and thus less concerned with the energy savings afforded by PSR).

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +2 -1
index 5d2715f78314..272f195b8c28 100644
@@ -152,7 +152,8 @@ void amdgpu_dm_crtc_set_panel_sr_feature(
 		struct amdgpu_dm_connector *aconn =
 			(struct amdgpu_dm_connector *) stream->dm_stream_context;
 
-		if (!aconn->disallow_edp_enter_psr) {
+		/* Do not enter PSR if multiple displays are active to prevent DMCUB hangs */
+		if (!aconn->disallow_edp_enter_psr && dm->dc->current_state->stream_count == 1) {
 			amdgpu_dm_psr_enable(stream);
 			if (dm->idle_workqueue &&
 			    (dm->dc->config.disable_ips == DMUB_IPS_ENABLE) &&
Signature · 1 line
2.43.0
maintainer
#2 lore raw
Quoted 23 lines · On 2026-08-06 10:34, [email protected] wrote:

[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

From: Mitchell Augustin <[email protected]>

Issue: https://gitlab.freedesktop.org/drm/amd/-/work_items/5394
Ubuntu BugLink: https://bugs.launchpad.net/bugs/2162904

This commit disables panel self-refresh when more than one display is active to eliminate a common hang and system crash that happens frequently on some laptops, evidently due to race conditions between the DMCUB, amdgpu module, and possibly other components which are exacerbated when more than one display is active.

To my knowledge, a fix for the underlying failure condition is not available upstream, so given how disruptive this is for impacted users, I propose disabling this feature under this condition until it is fixed. The main downside of disabling PSR is that it
will increase power consumption, but this should be barely noticeable to end users, since PSR will remain enabled on laptops unconnected to external monitors, and since laptops connected to external monitors are likely typically also connected to power (and thus less concerned with the energy savings afforded by PSR).

Quoted 2 lines

Hi Mitchell,

Do you know if this issue still occurs on 7.2-rc6? It includes a bunch of fixes targeting flip-done timeout issues that involved PSR.

Thanks,
Leo

Quoted 21 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +2 -2
index 5d2715f78314..272f195b8c28 100644
@@ -152,7 +152,8 @@ void amdgpu_dm_crtc_set_panel_sr_feature(
                struct amdgpu_dm_connector *aconn =
                        (struct amdgpu_dm_connector *) stream->dm_stream_context;
 
-               if (!aconn->disallow_edp_enter_psr) {
+               /* Do not enter PSR if multiple displays are active to prevent DMCUB hangs */
+               if (!aconn->disallow_edp_enter_psr && dm->dc->current_state->stream_count == 1) {
                        amdgpu_dm_psr_enable(stream);
                        if (dm->idle_workqueue &&
                            (dm->dc->config.disable_ips == DMUB_IPS_ENABLE) &&
--

2.43.0

#3 lore raw

Hi Leo,

I am not sure - I have only personally tested the latest Ubuntu kernel based on 7.0.0 (7.0.0-27.27). Could you link me to the relevant commits / mailing list entries? I can read through them and will try to give it a test soon if I have time.

-Mitchell Augustin

Quoted 49 lines · Leo Li
Quoted 23 lines · On 2026-08-06 10:34, [email protected] wrote:

[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

From: Mitchell Augustin <[email protected]>

Issue: https://gitlab.freedesktop.org/drm/amd/-/work_items/5394
Ubuntu BugLink: https://bugs.launchpad.net/bugs/2162904

This commit disables panel self-refresh when more than one display is active to eliminate a common hang and system crash that happens frequently on some laptops, evidently due to race conditions between the DMCUB, amdgpu module, and possibly other components which are exacerbated when more than one display is active.

To my knowledge, a fix for the underlying failure condition is not available upstream, so given how disruptive this is for impacted users, I propose disabling this feature under this condition until it is fixed. The main downside of disabling PSR is that it
will increase power consumption, but this should be barely noticeable to end users, since PSR will remain enabled on laptops unconnected to external monitors, and since laptops connected to external monitors are likely typically also connected to power (and thus less concerned with the energy savings afforded by PSR).

Quoted 2 lines

Hi Mitchell,

Do you know if this issue still occurs on 7.2-rc6? It includes a bunch of fixes targeting flip-done timeout issues that involved PSR.

Thanks,
Leo

Quoted 12 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -0
index 5d2715f78314..272f195b8c28 100644
@@ -152,7 +152,8 @@ void amdgpu_dm_crtc_set_panel_sr_feature(
                struct amdgpu_dm_connector *aconn =
                        (struct amdgpu_dm_connector *) stream->dm_stream_context;
 
Quoted 10 lines
Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +2 -2
-               if (!aconn->disallow_edp_enter_psr) {
+               /* Do not enter PSR if multiple displays are active to prevent DMCUB hangs */
+               if (!aconn->disallow_edp_enter_psr && dm->dc->current_state->stream_count == 1) {
                        amdgpu_dm_psr_enable(stream);
                        if (dm->idle_workqueue &&
                            (dm->dc->config.disable_ips == DMUB_IPS_ENABLE) &&
--

2.43.0

--
Mitchell Augustin
Software Engineer / Tech Lead - Ubuntu on NVIDIA DGX Email:[email protected] [email protected]
Location:United States of America (Central Time)

canonical.com
ubuntu.com

maintainer
#4 lore raw
Quoted 8 lines · Mitchell Augustin

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Leo,

I am not sure - I have only personally tested the latest Ubuntu kernel based on 7.0.0 (7.0.0-27.27). Could you link me to the relevant commits / mailing list entries? I can read through them and will try to give it a test soon if I have time.

I created a 7.0.y based branch with all the fixes here, see the top 5 commits:
https://gitlab.freedesktop.org/leoli/linux-asdn/-/commits/lileo%2Fflip_done_timeout_corruption_fixes-7.0.y/?ref_type=heads

- Leo

Quoted 2 lines

-Mitchell Augustin

#5 lore raw

Perfect, thank you! I will apply those all to my Ubuntu kernel and see if it eliminates the issue there (hopefully sometime next week).

Quoted 23 lines · Leo Li
Quoted 8 lines · Mitchell Augustin

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Leo,

I am not sure - I have only personally tested the latest Ubuntu kernel based on 7.0.0 (7.0.0-27.27). Could you link me to the relevant commits / mailing list entries? I can read through them and will try to give it a test soon if I have time.

I created a 7.0.y based branch with all the fixes here, see the top 5 commits:
https://gitlab.freedesktop.org/leoli/linux-asdn/-/commits/lileo%2Fflip_done_timeout_corruption_fixes-7.0.y/?ref_type=heads

- Leo

Quoted 2 lines

-Mitchell Augustin

Signature · 9 lines
Mitchell Augustin
Software Engineer / Tech Lead - Ubuntu on NVIDIA DGX
Email:[email protected]
[email protected]
Location:United States of America (Central Time)


canonical.com
ubuntu.com
#6 lore raw

Hi Leo,

That series did not fix the bug on my ASUS ROG Zephyrus G15 running Ubuntu Resolute.

Quoted 40 lines · Mitchell Augustin

Perfect, thank you! I will apply those all to my Ubuntu kernel and see if it eliminates the issue there (hopefully sometime next week).

Quoted 13 lines · Leo Li
Quoted 8 lines · Mitchell Augustin

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Leo,

I am not sure - I have only personally tested the latest Ubuntu kernel based on 7.0.0 (7.0.0-27.27). Could you link me to the relevant commits / mailing list entries? I can read through them and will try to give it a test soon if I have time.

Quoted 10 lines

I created a 7.0.y based branch with all the fixes here, see the top 5 commits:
https://gitlab.freedesktop.org/leoli/linux-asdn/-/commits/lileo%2Fflip_done_timeout_corruption_fixes-7.0.y/?ref_type=heads

- Leo

Quoted 2 lines

-Mitchell Augustin

--
Mitchell Augustin
Software Engineer / Tech Lead - Ubuntu on NVIDIA DGX Email:[email protected] [email protected]
Location:United States of America (Central Time)

canonical.com
ubuntu.com

Signature · 9 lines
Mitchell Augustin
Software Engineer / Tech Lead - Ubuntu on NVIDIA DGX
Email:[email protected]
[email protected]
Location:United States of America (Central Time)


canonical.com
ubuntu.com