aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1053-drm-amd-dal-Change-reset-pipe_ctx-check-conditon.patch
blob: 50a0f8fbb65c8825a82da9f10cbc9c35489bc4b2 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From 2f548663a8e1b073634cafd3bdad7f9c57b1a6f4 Mon Sep 17 00:00:00 2001
From: Yongqiang Sun <yongqiang.sun@amd.com>
Date: Thu, 7 Apr 2016 10:47:08 -0400
Subject: [PATCH 1053/1110] drm/amd/dal: Change reset pipe_ctx check conditon

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc_resource.c      | 43 ++++++++++++++++++++++
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    | 43 ----------------------
 drivers/gpu/drm/amd/dal/dc/inc/core_types.h        |  5 ---
 drivers/gpu/drm/amd/dal/dc/inc/resource.h          |  4 ++
 4 files changed, 47 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c b/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c
index 12e4515..3f62986 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c
@@ -1269,3 +1269,46 @@ enum dc_status resource_map_clock_resources(
 
 	return DC_OK;
 }
+
+static bool check_timing_change(struct core_stream *cur_stream,
+		struct core_stream *new_stream)
+{
+	if (cur_stream == NULL)
+		return true;
+
+	/* If sink pointer changed, it means this is a hotplug, we should do
+	 * full hw setting.
+	 */
+	if (cur_stream->sink != new_stream->sink)
+		return true;
+
+	return !resource_is_same_timing(
+					&cur_stream->public.timing,
+					&new_stream->public.timing);
+}
+
+bool pipe_need_reprogram(
+		struct pipe_ctx *pipe_ctx_old,
+		struct pipe_ctx *pipe_ctx)
+{
+	if (pipe_ctx_old->stream->sink != pipe_ctx->stream->sink)
+		return true;
+
+	if (pipe_ctx_old->signal != pipe_ctx->signal)
+		return true;
+
+	if (pipe_ctx_old->audio != pipe_ctx->audio)
+		return true;
+
+	if (pipe_ctx_old->clock_source != pipe_ctx->clock_source)
+		return true;
+
+	if (pipe_ctx_old->stream_enc != pipe_ctx->stream_enc)
+		return true;
+
+	if (check_timing_change(pipe_ctx_old->stream, pipe_ctx->stream))
+		return true;
+
+
+	return false;
+}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
index 62363ef..d1dd0d5 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
@@ -1156,49 +1156,6 @@ static void set_drr(struct pipe_ctx **pipe_ctx,
 	}
 }
 
-static bool check_timing_change(struct core_stream *cur_stream,
-		struct core_stream *new_stream)
-{
-	if (cur_stream == NULL)
-		return true;
-
-	/* If sink pointer changed, it means this is a hotplug, we should do
-	 * full hw setting.
-	 */
-	if (cur_stream->sink != new_stream->sink)
-		return true;
-
-	return !resource_is_same_timing(
-					&cur_stream->public.timing,
-					&new_stream->public.timing);
-}
-
-static bool pipe_need_reprogram(
-		struct pipe_ctx *pipe_ctx_old,
-		struct pipe_ctx *pipe_ctx)
-{
-	if (pipe_ctx_old->stream->sink != pipe_ctx->stream->sink)
-		return true;
-
-	if (pipe_ctx_old->signal != pipe_ctx->signal)
-		return true;
-
-	if (pipe_ctx_old->audio != pipe_ctx->audio)
-		return true;
-
-	if (pipe_ctx_old->clock_source != pipe_ctx->clock_source)
-		return true;
-
-	if (pipe_ctx_old->stream_enc != pipe_ctx->stream_enc)
-		return true;
-
-	if (check_timing_change(pipe_ctx_old->stream, pipe_ctx->stream))
-		return true;
-
-
-	return false;
-}
-
 /*TODO: const validate_context*/
 static enum dc_status apply_ctx_to_hw(
 		struct core_dc *dc,
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/core_types.h b/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
index 5994ad1..94e0adf 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
@@ -290,11 +290,6 @@ struct pipe_ctx {
 	struct encoder_info_frame encoder_info_frame;
 
 	uint8_t pipe_idx;
-
-	struct flags {
-		bool unchanged;
-		bool timing_changed;
-	} flags;
 };
 
 struct resource_context {
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/resource.h b/drivers/gpu/drm/amd/dal/dc/inc/resource.h
index 00843a4..e66f73e 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/resource.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/resource.h
@@ -92,5 +92,9 @@ enum dc_status resource_map_clock_resources(
 		const struct core_dc *dc,
 		struct validate_context *context);
 
+bool pipe_need_reprogram(
+		struct pipe_ctx *pipe_ctx_old,
+		struct pipe_ctx *pipe_ctx);
+
 
 #endif /* DRIVERS_GPU_DRM_AMD_DAL_DEV_DC_INC_RESOURCE_H_ */
-- 
2.7.4