Blob Blame History Raw
From: Yongqiang Sun <yongqiang.sun@amd.com>
Date: Wed, 3 May 2017 10:25:51 -0400
Subject: drm/amd/display: Only apply ctx for specific surface.
Git-commit: 8d1b404744d0040d2d85c1ff7737a38f29770826
Patch-mainline: v4.15-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -1689,19 +1689,21 @@ static void dcn10_apply_ctx_for_surface(
 {
 	int i;
 
-	memcpy(context->res_ctx.mpc_tree,
-			dc->current_context->res_ctx.mpc_tree,
-			sizeof(struct mpc_tree_cfg) * dc->res_pool->pipe_count);
-
 	for (i = 0; i < dc->res_pool->pipe_count; i++) {
 		struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
 
-		if (!pipe_ctx->surface)
+		if (!pipe_ctx->surface || pipe_ctx->surface != surface)
 			continue;
 
+
 		/* looking for top pipe to program */
-		if (!pipe_ctx->top_pipe)
+		if (!pipe_ctx->top_pipe) {
+			memcpy(context->res_ctx.mpc_tree,
+					dc->current_context->res_ctx.mpc_tree,
+					sizeof(struct mpc_tree_cfg) * dc->res_pool->pipe_count);
+
 			program_all_pipe_in_tree(dc, pipe_ctx, context);
+		}
 	}
 
 	for (i = 0; i < dc->res_pool->pipe_count; i++) {