aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0403-drm-amd-display-Only-apply-ctx-for-specific-surface.patch
blob: bafd26c65d16baf7c3969b56a090522c4c81ad72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From b842b68593321e3b3db8cc0e53ca7e16d60075c8 Mon Sep 17 00:00:00 2001
From: Yongqiang Sun <yongqiang.sun@amd.com>
Date: Wed, 3 May 2017 10:25:51 -0400
Subject: [PATCH 0403/4131] drm/amd/display: Only apply ctx for specific
 surface.

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>
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index fb4eb43..ece8c96 100644
--- 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++) {
-- 
2.7.4