aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0642-drm-amd-display-mpcc-disconnect-and-pipe-pg-in-multi.patch
blob: 890e8d60c69aac08f26df58be7c1e95cbd670b20 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From 8420abaf2b9aedb6844558a4347f1e152e1cc2a5 Mon Sep 17 00:00:00 2001
From: Tony Cheng <tony.cheng@amd.com>
Date: Wed, 19 Jul 2017 20:22:22 -0400
Subject: [PATCH 0642/4131] drm/amd/display: mpcc disconnect and pipe pg in
 multi-display

still quite hacky.  but this address not properly shutdown pipe video underlay
+ enable another display case, as well as mode changes with video overlay.

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 23 +++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 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 b5a9253..d607ca9 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
@@ -1669,30 +1669,46 @@ static void dcn10_apply_ctx_for_surface(
 		struct core_surface *surface,
 		struct validate_context *context)
 {
-	int i;
+	int i, be_idx;
 
 	if (dc->public.debug.sanity_checks)
 		verify_allow_pstate_change_high(dc->hwseq);
 
+	if (!surface)
+		return;
+
+	for (be_idx = 0; be_idx < dc->res_pool->pipe_count; be_idx++)
+		if (surface == context->res_ctx.pipe_ctx[be_idx].surface)
+			break;
+
 	/* reset unused mpcc */
 	for (i = 0; i < dc->res_pool->pipe_count; i++) {
 		struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
 		struct pipe_ctx *old_pipe_ctx =
 				&dc->current_context->res_ctx.pipe_ctx[i];
+
+		if (!pipe_ctx->surface && !old_pipe_ctx->surface)
+			continue;
+
 		/*
 		 * Powergate reused pipes that are not powergated
 		 * fairly hacky right now, using opp_id as indicator
 		 */
+
 		if (pipe_ctx->surface && !old_pipe_ctx->surface) {
-			if (pipe_ctx->mpcc->opp_id != 0xf)
+			if (pipe_ctx->mpcc->opp_id != 0xf && pipe_ctx->tg->inst == be_idx)
 				dcn10_power_down_fe(dc, pipe_ctx->pipe_idx);
 		}
 
+
 		if ((!pipe_ctx->surface && old_pipe_ctx->surface)
 				|| (!pipe_ctx->stream && old_pipe_ctx->stream)) {
 			struct mpcc_cfg mpcc_cfg;
 			int opp_id_cached = old_pipe_ctx->mpcc->opp_id;
 
+			if (old_pipe_ctx->tg->inst != be_idx)
+				continue;
+
 			if (!old_pipe_ctx->top_pipe) {
 				ASSERT(0);
 				continue;
@@ -1725,9 +1741,6 @@ static void dcn10_apply_ctx_for_surface(
 		}
 	}
 
-	if (!surface)
-		return;
-
 	for (i = 0; i < dc->res_pool->pipe_count; i++) {
 		struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
 
-- 
2.7.4