aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1000-drm-amd-display-Remove-unneeded-code.patch
blob: c6c3f3eceee1947e5bf63659d4a71583200026f8 (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
From 80a32ccadbfe1d0345827e184219107fe6343a34 Mon Sep 17 00:00:00 2001
From: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Date: Mon, 21 Aug 2017 16:28:39 -0400
Subject: [PATCH 1000/4131] drm/amd/display: Remove unneeded code

Change-Id: I1735203833573473200e19bf0324aecd92663535
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 145 ----------------------
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c |  73 -----------
 drivers/gpu/drm/amd/display/dc/dc.h               |  71 -----------
 3 files changed, 289 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 6c5e857..c6fdf62 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -672,67 +672,6 @@ void dc_destroy(struct dc **dc)
 	*dc = NULL;
 }
 
-static bool validate_streams (
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count)
-{
-	int i;
-
-	for (i = 0; i < set_count; i++)
-		if (!dc_validate_stream(dc, set[i].stream))
-			return false;
-
-	return true;
-}
-
-static bool validate_surfaces(
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count)
-{
-	int i, j;
-
-	for (i = 0; i < set_count; i++)
-		for (j = 0; j < set[i].plane_count; j++)
-			if (!dc_validate_plane(dc, set[i].plane_states[j]))
-				return false;
-
-	return true;
-}
-
-bool dc_validate_resources(
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		uint8_t set_count)
-{
-	bool result = false;
-	struct validate_context *context;
-
-	if (!validate_streams(dc, set, set_count))
-		return false;
-
-	if (!validate_surfaces(dc, set, set_count))
-		return false;
-
-	context = dm_alloc(sizeof(struct validate_context));
-	if (context == NULL)
-		goto context_alloc_fail;
-
-	atomic_inc(&context->ref_count);
-
-	dc_resource_validate_ctx_copy_construct_current(dc, context);
-
-	result = dc_validate_with_context(
-				dc, set, set_count, context);
-
-context_alloc_fail:
-	dc_release_validate_context(context);
-	context = NULL;
-
-	return result;
-}
-
 bool dc_validate_guaranteed(
 		struct dc *dc,
 		struct dc_stream_state *stream)
@@ -857,24 +796,6 @@ static bool context_changed(
 	return false;
 }
 
-static bool streams_changed(
-		struct dc *dc,
-		struct dc_stream_state *streams[],
-		uint8_t stream_count)
-{
-	uint8_t i;
-
-	if (stream_count != dc->current_context->stream_count)
-		return true;
-
-	for (i = 0; i < dc->current_context->stream_count; i++) {
-		if (dc->current_context->streams[i] != streams[i])
-			return true;
-	}
-
-	return false;
-}
-
 bool dc_enable_stereo(
 	struct dc *dc,
 	struct validate_context *context,
@@ -999,72 +920,6 @@ bool dc_commit_context(struct dc *dc, struct validate_context *context)
 }
 
 
-bool dc_commit_streams(
-	struct dc *dc,
-	struct dc_stream_state *streams[],
-	uint8_t stream_count)
-{
-	struct dc  *core_dc = dc;
-	bool result = false;
-	struct validate_context *context;
-	struct dc_validation_set set[MAX_STREAMS] = { {0, {0} } };
-	int i;
-
-	if (false == streams_changed(core_dc, streams, stream_count))
-		return DC_OK;
-
-	dm_logger_write(core_dc->ctx->logger, LOG_DC, "%s: %d streams\n",
-				__func__, stream_count);
-
-	for (i = 0; i < stream_count; i++) {
-		struct dc_stream_state *stream = streams[i];
-		struct dc_stream_status *status = dc_stream_get_status(stream);
-		int j;
-
-		dc_stream_log(stream,
-				core_dc->ctx->logger,
-				LOG_DC);
-
-		set[i].stream = stream;
-
-		if (status) {
-			set[i].plane_count = status->plane_count;
-			for (j = 0; j < status->plane_count; j++)
-				set[i].plane_states[j] = status->plane_states[j];
-		}
-
-	}
-
-	if (!validate_streams(dc, set, stream_count))
-		return false;
-
-	if (!validate_surfaces(dc, set, stream_count))
-		return false;
-
-	context = dm_alloc(sizeof(struct validate_context));
-	if (context == NULL)
-		goto context_alloc_fail;
-
-	atomic_inc(&context->ref_count);
-
-	dc_resource_validate_ctx_copy_construct_current(dc, context);
-
-	result = dc_validate_with_context(
-			dc, set, stream_count, context);
-	if (!result) {
-		BREAK_TO_DEBUGGER();
-		goto fail;
-	}
-
-	result = dc_commit_context_no_check(dc, context);
-
-fail:
-	dc_release_validate_context(context);
-
-context_alloc_fail:
-	return result;
-}
-
 bool dc_post_update_surfaces_to_stream(struct dc *dc)
 {
 	int i;
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 6b4eb4c..90bf367 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -1633,79 +1633,6 @@ void dc_resource_validate_ctx_copy_construct_current(
 	dc_resource_validate_ctx_copy_construct(dc->current_context, dst_ctx);
 }
 
-bool dc_validate_with_context(
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count,
-		struct validate_context *context)
-{
-	int i, j;
-	enum dc_status res = DC_ERROR_UNEXPECTED;
-	bool found = false;
-	int old_stream_count = context->stream_count;
-	struct dc_stream_state *del_streams[MAX_PIPES] = { 0 };
-	struct dc_stream_state *add_streams[MAX_PIPES] = { 0 };
-	int del_streams_count = 0;
-	int add_streams_count = 0;
-
-
-	/* First remove from context all deleted streams */
-	for (i = 0; i < old_stream_count; i++) {
-		struct dc_stream_state *stream = context->streams[i];
-
-		for (j = 0; j < set_count; j++) {
-			if (stream == set[j].stream) {
-				found = true;
-				break;
-			}
-		}
-
-		if (!found)
-			del_streams[del_streams_count++] = stream;
-
-		found = false;
-	}
-
-	/* Now add new ones */
-	for (i = 0; i < set_count; i++) {
-		struct dc_stream_state *stream = set[i].stream;
-
-		for (j = 0; j < old_stream_count; j++) {
-			if (stream == context->streams[j]) {
-				found = true;
-				break;
-			}
-		}
-
-		if (!found)
-			add_streams[add_streams_count++] = stream;
-
-		found = false;
-	}
-
-	for (i = 0; i < del_streams_count; i++)
-		if (!dc_remove_stream_from_ctx(dc, context, del_streams[i]))
-			goto fail;
-
-	for (i = 0; i < add_streams_count; i++)
-		if (!dc_add_stream_to_ctx(dc, context, add_streams[i]))
-			goto fail;
-
-	if (!dc_validate_global_state(dc, set, set_count, context))
-		goto fail;
-
-	res = DC_OK;
-
-fail:
-	if (res != DC_OK) {
-		dm_logger_write(dc->ctx->logger, LOG_WARNING,
-				"%s:resource validation failed, dc_status:%d\n",
-				__func__,
-				res);
-}
-	return res == DC_OK;
-}
-
 bool dc_validate_global_state(
 		struct dc *dc,
 		const struct dc_validation_set set[],
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 65152bf..acc326d 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -657,23 +657,12 @@ bool dc_validate_stream(struct dc *dc, struct dc_stream_state *stream);
 
 bool dc_validate_plane(struct dc *dc, const struct dc_plane_state *plane_state);
 
-bool dc_validate_with_context(
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		int set_count,
-		struct validate_context *context);
-
 bool dc_validate_global_state(
 		struct dc *dc,
 		const struct dc_validation_set set[],
 		int set_count,
 		struct validate_context *new_ctx);
 
-bool dc_validate_resources(
-		struct dc *dc,
-		const struct dc_validation_set set[],
-		uint8_t set_count);
-
 /*
  * This function takes a stream and checks if it is guaranteed to be supported.
  * Guaranteed means that MAX_COFUNC similar streams are supported.
@@ -682,10 +671,6 @@ bool dc_validate_resources(
  *   No hardware is programmed for call.  Only validation is done.
  */
 
-bool dc_validate_guaranteed(
-		struct dc *dc,
-		struct dc_stream_state *stream);
-
 void dc_resource_validate_ctx_copy_construct(
 		const struct validate_context *src_ctx,
 		struct validate_context *dst_ctx);
@@ -715,10 +700,6 @@ bool dc_commit_context(struct dc *dc, struct validate_context *context);
  *   Phy, Encoder, Timing Generator are programmed and enabled.
  *   New streams are enabled with blank stream; no memory read.
  */
-bool dc_commit_streams(
-		struct dc *dc,
-		struct dc_stream_state *streams[],
-		uint8_t stream_count);
 /*
  * Enable stereo when commit_streams is not required,
  * for example, frame alternate.
@@ -872,18 +853,10 @@ const struct dc_link_status *dc_link_get_status(const struct dc_link *dc_link);
  */
 struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_index);
 
-struct dwbc *dc_get_dwb_at_pipe(struct dc *dc, uint32_t pipe);
-
-/* Return id of physical connector represented by a dc_link at link_index.*/
-const struct graphics_object_id dc_get_link_id_at_index(
-		struct dc *dc, uint32_t link_index);
-
 /* Set backlight level of an embedded panel (eDP, LVDS). */
 bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,
 		uint32_t frame_ramp, const struct dc_stream_state *stream);
 
-bool dc_link_set_abm_disable(const struct dc_link *dc_link);
-
 bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable);
 
 bool dc_link_get_psr_state(const struct dc_link *dc_link, uint32_t *psr_state);
@@ -922,7 +895,6 @@ void dc_link_remove_remote_sink(
 	struct dc_sink *sink);
 
 /* Used by diagnostics for virtual link at the moment */
-void dc_link_set_sink(struct dc_link *link, struct dc_sink *sink);
 
 void dc_link_dp_set_drive_settings(
 	struct dc_link *link,
@@ -985,8 +957,6 @@ struct dc_sink {
 void dc_sink_retain(struct dc_sink *sink);
 void dc_sink_release(struct dc_sink *sink);
 
-const struct audio **dc_get_audios(struct dc *dc);
-
 struct dc_sink_init_data {
 	enum signal_type sink_signal;
 	struct dc_link *link;
@@ -995,8 +965,6 @@ struct dc_sink_init_data {
 };
 
 struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params);
-bool dc_sink_get_container_id(struct dc_sink *dc_sink, struct dc_container_id *container_id);
-bool dc_sink_set_container_id(struct dc_sink *dc_sink, const struct dc_container_id *container_id);
 
 /*******************************************************************************
  * Cursor interfaces - To manages the cursor within a stream
@@ -1042,45 +1010,6 @@ void dc_resume(struct dc *dc);
  * DPCD access interfaces
  */
 
-bool dc_read_aux_dpcd(
-		struct dc *dc,
-		uint32_t link_index,
-		uint32_t address,
-		uint8_t *data,
-		uint32_t size);
-
-bool dc_write_aux_dpcd(
-		struct dc *dc,
-		uint32_t link_index,
-		uint32_t address,
-		const uint8_t *data,
-		uint32_t size);
-
-bool dc_read_aux_i2c(
-		struct dc *dc,
-		uint32_t link_index,
-		enum i2c_mot_mode mot,
-		uint32_t address,
-		uint8_t *data,
-		uint32_t size);
-
-bool dc_write_aux_i2c(
-		struct dc *dc,
-		uint32_t link_index,
-		enum i2c_mot_mode mot,
-		uint32_t address,
-		const uint8_t *data,
-		uint32_t size);
-
-bool dc_query_ddc_data(
-		struct dc *dc,
-		uint32_t link_index,
-		uint32_t address,
-		uint8_t *write_buf,
-		uint32_t write_size,
-		uint8_t *read_buf,
-		uint32_t read_size);
-
 bool dc_submit_i2c(
 		struct dc *dc,
 		uint32_t link_index,
-- 
2.7.4