[PATCH] drm/amd/display: let update_planes_and_stream_state define minimal state

Melissa Wen mwen at igalia.com
Thu Aug 22 13:17:04 UTC 2024


Artifacts appear when using dc->current_state as the minimal transition
state in a scenario where update_planes_and_stream_state() would set the
context as the new one because the update type is FULL. To prevent those
artifacts, instead of defining the minimal state according to plane
addition (current context) or removal (new context) - when forcing
minimal pipe splitting - let update_planes_and_stream_state() define the
suitable context for minimal transition.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3441
Reported-by: Matthew Schwartz <mattschwartz at gwu.edu>
Tested-by: Matthew Schwartz <mattschwartz at gwu.edu>
Signed-off-by: Melissa Wen <mwen at igalia.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index b1253e4c81a8..a9525c2df4e0 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -4998,11 +4998,6 @@ static bool update_planes_and_stream_v2(struct dc *dc,
 			surface_count,
 			&is_plane_addition);
 
-	/* on plane addition, minimal state is the current one */
-	if (force_minimal_pipe_splitting && is_plane_addition &&
-		!commit_minimal_transition_state(dc, dc->current_state))
-		return false;
-
 	if (!update_planes_and_stream_state(
 			dc,
 			srf_updates,
@@ -5013,13 +5008,17 @@ static bool update_planes_and_stream_v2(struct dc *dc,
 			&context))
 		return false;
 
-	/* on plane removal, minimal state is the new one */
-	if (force_minimal_pipe_splitting && !is_plane_addition) {
+	/*
+	 * minimal state is determined by update_planes_and_stream_state:
+	 * current or new context according to the update type.
+	 */
+	if (force_minimal_pipe_splitting) {
 		if (!commit_minimal_transition_state(dc, context)) {
 			dc_state_release(context);
 			return false;
 		}
-		update_type = UPDATE_TYPE_FULL;
+		if (!is_plane_addition)
+			update_type = UPDATE_TYPE_FULL;
 	}
 
 	if (dc->hwss.is_pipe_topology_transition_seamless &&
-- 
2.43.0



More information about the dri-devel mailing list