Skip to contentSkip to conversation

drm/amd/display: skip pre-flip post_update on DCE

PATCH In review [email protected] 3 participants 3 messages Nov 5 – Nov 11 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: skip pre-flip post_update on DCE

From: Wang Jiang <[email protected]>

The v5.15.119 backport of the dc_update_planes_and_stream series (commit 3c1aa91b37f9 "drm/amd/display: Add wrapper to call planes and stream update", upstream commit 81f743a08f3b) made update_planes_and_stream_adapter() call dc_post_update_surfaces_to_stream() before every UPDATE_TYPE_FAST flip.

In mainline that series was merged in the same cycle as commit 32953485c558 ("drm/amd/display: Do not update DRR while BW optimizations pending"), which restructured dc_post_update_surfaces_to_stream() so that disable_plane()/optimize_bandwidth() only run on DCN, retaining the legacy behaviour for DCE. That companion commit was never backported to 5.15.y, so on DCE every desktop flip now runs disable_plane() for each unused pipe - an ATOM enable_disp_power_gating VBIOS call each - plus optimize_bandwidth() immediately before the new surface address is programmed.

On Carrizo (DCE 11) this occasionally wedges the active pipe: the surface update stays GRPH_SURFACE_UPDATE_PENDING set forever and is never taken, GRPH_PFLIP never fires, drm_atomic_helper_wait_for_flip_done() times out and the desktop freezes. When it hits the first desktop commit after boot, the pipe scans out zero data, which shows as a green screen on YCbCr 4:4:4 HDMI outputs (black on RGB/DP). A VT switch recovers because the full modeset reprograms the front end. Wedging boots also show "atombios stuck in loop" in the EnableDispPowerGating table and smu8 message timeouts. Later modesets can deadlock in dce_mi_free_dmif().

This is the same class of regression that commit 62e5a7e2333a ("drm/amd/display: Fix surface optimization regression on Carrizo") fixed for the previous call site in dc_commit_updates_for_stream(), which the new adapter path bypasses. Mainline is not affected (DCE is guarded inside dc_post_update_surfaces_to_stream(), later cleaned up by commit 9571dbaf98c8); 6.1.y, 6.6.y and 6.12.y all carry the guard. Only 5.15.y is missing it.

Restrict the pre-update call to DCN, matching mainline behaviour. The full mainline rework does not backport cleanly; this is the minimal equivalent for 5.15.y.

Tested on LENOVO 90K7S04400/3141 (Carrizo, Wani [1002:9874], DCE 11, BIOS M25KT37A): without this patch the wedge reproduces within minutes of desktop use on 5.15.120 and later; with it (and on v5.15.110 which predates the series) it does not reproduce.

Fixes 3c1aa91b37f9 ("drm/amd/display: Add wrapper to call planes and stream update")

---

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -376,7 +376,8 @@
 	/*
 	 * Previous frame finished and HW is ready for optimization.
 	 */
-	if (update_type == UPDATE_TYPE_FAST)
+	if (update_type == UPDATE_TYPE_FAST &&
+	    dc->ctx->dce_version >= DCE_VERSION_MAX)
 		dc_post_update_surfaces_to_stream(dc);
 
 	return dc_update_planes_and_stream(dc,
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 3 lines

Restrict the pre-update call to DCN, matching mainline behaviour. The full mainline rework does not backport cleanly; this is the minimal equivalent for 5.15.y.

This is a stable-only fix with no mainline equivalent, so I need an ack from the AMD display maintainers before I can queue it for 5.15.

Alex, Nicholas, could you take a look?

Signature · 2 lines
Thanks,
Sasha
#2 lore raw

Public

Quoted 11 lines

-----Original Message-----
From: Sasha Levin <[email protected]>
Sent: Thursday, November 5, 2026 1:39 PM
To: [email protected]
Cc: Sasha Levin <[email protected]>; [email protected]; amd- [email protected]; Deucher, Alexander <[email protected]>; Kazlauskas, Nicholas <[email protected]>; [email protected]; Wentland, Harry <[email protected]>; Wang Jiang <[email protected]>
Subject: Re: [PATCH 5.15] drm/amd/display: skip pre-flip post_update on DCE

Quoted 8 lines
Quoted 3 lines

Restrict the pre-update call to DCN, matching mainline behaviour. The full mainline rework does not backport cleanly; this is the minimal equivalent for 5.15.y.

This is a stable-only fix with no mainline equivalent, so I need an ack from the AMD display maintainers before I can queue it for 5.15.

Alex, Nicholas, could you take a look?

Quoted 4 lines

--
Thanks,
Sasha