aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0848-drm-amd-dal-Remove-public-interfaces-for-target_memo.patch
blob: 304eb661a57e59d56c3aa1c957efc718f8f77299 (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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
From a9c0d2a29f4e8fca9ce1ddf46dd34eb8ae646680 Mon Sep 17 00:00:00 2001
From: Aric Cyr <aric.cyr@amd.com>
Date: Sat, 27 Feb 2016 10:00:34 -0500
Subject: [PATCH 0848/1110] drm/amd/dal: Remove public interfaces for
 target_memory_request

Rename dc_target_*_memory_request() and make it static in dc.

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c        | 273 ++++++++++++++++++++++++++-
 drivers/gpu/drm/amd/dal/dc/core/dc_target.c | 276 ----------------------------
 drivers/gpu/drm/amd/dal/dc/dc.h             |   3 -
 3 files changed, 271 insertions(+), 281 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index d02f3c0..4ce2af2 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -398,6 +398,72 @@ static void destruct(struct dc *dc)
 	dm_free(dc->ctx, dc->ctx);
 }
 
+/*
+void ProgramPixelDurationV(unsigned int pixelClockInKHz )
+{
+	fixed31_32 pixel_duration = Fixed31_32(100000000, pixelClockInKHz) * 10;
+	unsigned int pixDurationInPico = round(pixel_duration);
+
+	DPG_PIPE_ARBITRATION_CONTROL1 arb_control;
+
+	arb_control.u32All = ReadReg (mmDPGV0_PIPE_ARBITRATION_CONTROL1);
+	arb_control.bits.PIXEL_DURATION = pixDurationInPico;
+	WriteReg (mmDPGV0_PIPE_ARBITRATION_CONTROL1, arb_control.u32All);
+
+	arb_control.u32All = ReadReg (mmDPGV1_PIPE_ARBITRATION_CONTROL1);
+	arb_control.bits.PIXEL_DURATION = pixDurationInPico;
+	WriteReg (mmDPGV1_PIPE_ARBITRATION_CONTROL1, arb_control.u32All);
+
+	WriteReg (mmDPGV0_PIPE_ARBITRATION_CONTROL2, 0x4000800);
+	WriteReg (mmDPGV0_REPEATER_PROGRAM, 0x11);
+
+	WriteReg (mmDPGV1_PIPE_ARBITRATION_CONTROL2, 0x4000800);
+	WriteReg (mmDPGV1_REPEATER_PROGRAM, 0x11);
+}
+*/
+static int8_t acquire_first_free_underlay(
+		struct resource_context *res_ctx,
+		struct core_stream *stream)
+{
+	if (!res_ctx->pipe_ctx[DCE110_UNDERLAY_IDX].stream) {
+		struct dc_bios *dcb;
+		struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[DCE110_UNDERLAY_IDX];
+
+		pipe_ctx->tg = res_ctx->pool.timing_generators[DCE110_UNDERLAY_IDX];
+		pipe_ctx->mi = res_ctx->pool.mis[DCE110_UNDERLAY_IDX];
+		/*pipe_ctx->ipp = res_ctx->pool.ipps[DCE110_UNDERLAY_IDX];*/
+		pipe_ctx->xfm = res_ctx->pool.transforms[DCE110_UNDERLAY_IDX];
+		pipe_ctx->opp = res_ctx->pool.opps[DCE110_UNDERLAY_IDX];
+		pipe_ctx->dis_clk = res_ctx->pool.display_clock;
+		pipe_ctx->pipe_idx = DCE110_UNDERLAY_IDX;
+
+		dcb = dal_adapter_service_get_bios_parser(
+						res_ctx->pool.adapter_srv);
+
+		stream->ctx->dc->hwss.enable_display_power_gating(
+			stream->ctx->dc->ctx,
+			DCE110_UNDERLAY_IDX,
+			dcb, PIPE_GATING_CONTROL_DISABLE);
+
+		if (!pipe_ctx->tg->funcs->set_blank(pipe_ctx->tg, true)) {
+			dm_error("DC: failed to blank crtc!\n");
+			BREAK_TO_DEBUGGER();
+		}
+
+		if (!pipe_ctx->tg->funcs->enable_crtc(pipe_ctx->tg)) {
+			BREAK_TO_DEBUGGER();
+		}
+
+		pipe_ctx->tg->funcs->set_blank_color(
+				pipe_ctx->tg,
+				COLOR_SPACE_YCBCR601);/* TODO unhardcode*/
+
+		pipe_ctx->stream = stream;
+		return DCE110_UNDERLAY_IDX;
+	}
+	return -1;
+}
+
 /*******************************************************************************
  * Public functions
  ******************************************************************************/
@@ -523,6 +589,52 @@ static bool targets_changed(
 	return false;
 }
 
+static void target_enable_memory_requests(struct dc_target *dc_target)
+{
+	uint8_t i, j;
+	struct core_target *target = DC_TARGET_TO_CORE(dc_target);
+	struct resource_context *res_ctx =
+		&target->ctx->dc->current_context.res_ctx;
+
+	for (i = 0; i < target->public.stream_count; i++) {
+		for (j = 0; j < MAX_PIPES; j++) {
+			struct timing_generator *tg = res_ctx->pipe_ctx[j].tg;
+
+			if (res_ctx->pipe_ctx[j].stream !=
+				DC_STREAM_TO_CORE(target->public.streams[i]))
+				continue;
+
+			if (!tg->funcs->set_blank(tg, false)) {
+				dm_error("DC: failed to unblank crtc!\n");
+				BREAK_TO_DEBUGGER();
+			}
+		}
+	}
+}
+
+static void target_disable_memory_requests(struct dc_target *dc_target)
+{
+	uint8_t i, j;
+	struct core_target *target = DC_TARGET_TO_CORE(dc_target);
+	struct resource_context *res_ctx =
+		&target->ctx->dc->current_context.res_ctx;
+
+	for (i = 0; i < target->public.stream_count; i++) {
+		for (j = 0; j < MAX_PIPES; j++) {
+			struct timing_generator *tg = res_ctx->pipe_ctx[j].tg;
+
+			if (res_ctx->pipe_ctx[j].stream !=
+				DC_STREAM_TO_CORE(target->public.streams[i]))
+				continue;
+
+			if (!tg->funcs->set_blank(tg, true)) {
+				dm_error("DC: failed to blank crtc!\n");
+				BREAK_TO_DEBUGGER();
+			}
+		}
+	}
+}
+
 bool dc_commit_targets(
 	struct dc *dc,
 	struct dc_target *targets[],
@@ -576,7 +688,7 @@ bool dc_commit_targets(
 
 	for (i = 0; i < dc->current_context.target_count; i++) {
 		/*TODO: optimize this to happen only when necessary*/
-		dc_target_disable_memory_requests(
+		target_disable_memory_requests(
 				&dc->current_context.targets[i]->public);
 	}
 
@@ -590,7 +702,7 @@ bool dc_commit_targets(
 	for (i = 0; i < context->target_count; i++) {
 		struct dc_target *dc_target = &context->targets[i]->public;
 		if (context->target_status[i].surface_count > 0)
-			dc_target_enable_memory_requests(dc_target);
+			target_enable_memory_requests(dc_target);
 	}
 
 	program_timing_sync(dc->ctx, context);
@@ -608,6 +720,163 @@ context_alloc_fail:
 	return (result == DC_OK);
 }
 
+bool dc_commit_surfaces_to_target(
+		struct dc *dc,
+		struct dc_surface *new_surfaces[],
+		uint8_t new_surface_count,
+		struct dc_target *dc_target)
+
+{
+	int i, j;
+	uint32_t prev_disp_clk = dc->current_context.bw_results.dispclk_khz;
+	struct core_target *target = DC_TARGET_TO_CORE(dc_target);
+	struct dc_target_status *target_status = NULL;
+	struct validate_context *context;
+	int current_enabled_surface_count = 0;
+	int new_enabled_surface_count = 0;
+	bool is_mpo_turning_on = false;
+
+	context = dm_alloc(dc->ctx, sizeof(struct validate_context));
+
+	val_ctx_copy_construct(&dc->current_context, context);
+
+	/* Cannot commit surface to a target that is not commited */
+	for (i = 0; i < context->target_count; i++)
+		if (target == context->targets[i])
+			break;
+
+	target_status = &context->target_status[i];
+
+	if (!dal_adapter_service_is_in_accelerated_mode(
+						dc->res_pool.adapter_srv)
+		|| i == context->target_count) {
+		BREAK_TO_DEBUGGER();
+		goto unexpected_fail;
+	}
+
+	for (i = 0; i < target_status->surface_count; i++)
+		if (target_status->surfaces[i]->visible)
+			current_enabled_surface_count++;
+
+	for (i = 0; i < new_surface_count; i++)
+		if (new_surfaces[i]->visible)
+			new_enabled_surface_count++;
+
+	/* TODO unhack mpo */
+	if (new_surface_count == 2 && target_status->surface_count < 2) {
+		acquire_first_free_underlay(&context->res_ctx,
+				DC_STREAM_TO_CORE(dc_target->streams[0]));
+		is_mpo_turning_on = true;
+	} else if (new_surface_count < 2 && target_status->surface_count == 2) {
+		context->res_ctx.pipe_ctx[DCE110_UNDERLAY_IDX].stream = NULL;
+		context->res_ctx.pipe_ctx[DCE110_UNDERLAY_IDX].surface = NULL;
+	}
+
+	dal_logger_write(dc->ctx->logger,
+				LOG_MAJOR_INTERFACE_TRACE,
+				LOG_MINOR_COMPONENT_DC,
+				"%s: commit %d surfaces to target 0x%x\n",
+				__func__,
+				new_surface_count,
+				dc_target);
+
+
+	if (!attach_surfaces_to_context(
+			new_surfaces, new_surface_count, dc_target, context)) {
+		BREAK_TO_DEBUGGER();
+		goto unexpected_fail;
+	}
+
+	for (i = 0; i < new_surface_count; i++)
+		for (j = 0; j < MAX_PIPES; j++) {
+			if (context->res_ctx.pipe_ctx[j].surface !=
+					DC_SURFACE_TO_CORE(new_surfaces[i]))
+				continue;
+
+			build_scaling_params(
+				new_surfaces[i], &context->res_ctx.pipe_ctx[j]);
+		}
+
+	if (dc->res_pool.funcs->validate_bandwidth(dc, context) != DC_OK) {
+		BREAK_TO_DEBUGGER();
+		goto unexpected_fail;
+	}
+
+	if (prev_disp_clk < context->bw_results.dispclk_khz ||
+		(is_mpo_turning_on &&
+			prev_disp_clk == context->bw_results.dispclk_khz)) {
+		dc->hwss.program_bw(dc, context);
+		pplib_apply_display_requirements(dc, context,
+						&context->pp_display_cfg);
+	}
+
+	if (current_enabled_surface_count > 0 && new_enabled_surface_count == 0)
+		target_disable_memory_requests(dc_target);
+
+	for (i = 0; i < new_surface_count; i++)
+		for (j = 0; j < MAX_PIPES; j++) {
+			struct dc_surface *dc_surface = new_surfaces[i];
+			struct core_surface *surface =
+						DC_SURFACE_TO_CORE(dc_surface);
+			struct pipe_ctx *pipe_ctx =
+						&context->res_ctx.pipe_ctx[j];
+			struct core_gamma *gamma = NULL;
+
+			if (pipe_ctx->surface !=
+					DC_SURFACE_TO_CORE(new_surfaces[i]))
+				continue;
+
+			dal_logger_write(dc->ctx->logger,
+						LOG_MAJOR_INTERFACE_TRACE,
+						LOG_MINOR_COMPONENT_DC,
+						"Pipe:%d 0x%x: src: %d, %d, %d,"
+						" %d; dst: %d, %d, %d, %d;\n",
+						pipe_ctx->pipe_idx,
+						dc_surface,
+						dc_surface->src_rect.x,
+						dc_surface->src_rect.y,
+						dc_surface->src_rect.width,
+						dc_surface->src_rect.height,
+						dc_surface->dst_rect.x,
+						dc_surface->dst_rect.y,
+						dc_surface->dst_rect.width,
+						dc_surface->dst_rect.height);
+
+			if (surface->public.gamma_correction)
+				gamma = DC_GAMMA_TO_CORE(
+					surface->public.gamma_correction);
+
+			dc->hwss.set_gamma_correction(
+					pipe_ctx->ipp,
+					pipe_ctx->opp,
+					gamma, surface);
+
+			dc->hwss.set_plane_config(
+				dc, pipe_ctx, &context->res_ctx);
+		}
+
+	dc->hwss.update_plane_addrs(dc, &context->res_ctx);
+
+	/* Lower display clock if necessary */
+	if (prev_disp_clk > context->bw_results.dispclk_khz) {
+		dc->hwss.program_bw(dc, context);
+		pplib_apply_display_requirements(dc, context,
+						&context->pp_display_cfg);
+	}
+
+	val_ctx_destruct(&dc->current_context);
+	dc->current_context = *context;
+	dm_free(dc->ctx, context);
+	return true;
+
+unexpected_fail:
+
+	val_ctx_destruct(context);
+
+	dm_free(dc->ctx, context);
+	return false;
+}
+
 uint8_t dc_get_current_target_count(const struct dc *dc)
 {
 	return dc->current_context.target_count;
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
index 66aae5f..bbcfbf5 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c
@@ -30,13 +30,6 @@
 #include "ipp.h"
 #include "timing_generator.h"
 
-#define COEFF_RANGE	3
-#define REGAMMA_COEFF_A0	31308
-#define REGAMMA_COEFF_A1	12920
-#define REGAMMA_COEFF_A2	55
-#define REGAMMA_COEFF_A3	55
-#define REGAMMA_COEFF_GAMMA	2400
-
 struct target {
 	struct core_target protected;
 	int ref_count;
@@ -136,229 +129,6 @@ target_alloc_fail:
 	return NULL;
 }
 
-/*
-void ProgramPixelDurationV(unsigned int pixelClockInKHz )
-{
-	fixed31_32 pixel_duration = Fixed31_32(100000000, pixelClockInKHz) * 10;
-	unsigned int pixDurationInPico = round(pixel_duration);
-
-	DPG_PIPE_ARBITRATION_CONTROL1 arb_control;
-
-	arb_control.u32All = ReadReg (mmDPGV0_PIPE_ARBITRATION_CONTROL1);
-	arb_control.bits.PIXEL_DURATION = pixDurationInPico;
-	WriteReg (mmDPGV0_PIPE_ARBITRATION_CONTROL1, arb_control.u32All);
-
-	arb_control.u32All = ReadReg (mmDPGV1_PIPE_ARBITRATION_CONTROL1);
-	arb_control.bits.PIXEL_DURATION = pixDurationInPico;
-	WriteReg (mmDPGV1_PIPE_ARBITRATION_CONTROL1, arb_control.u32All);
-
-	WriteReg (mmDPGV0_PIPE_ARBITRATION_CONTROL2, 0x4000800);
-	WriteReg (mmDPGV0_REPEATER_PROGRAM, 0x11);
-
-	WriteReg (mmDPGV1_PIPE_ARBITRATION_CONTROL2, 0x4000800);
-	WriteReg (mmDPGV1_REPEATER_PROGRAM, 0x11);
-}
-*/
-static int8_t acquire_first_free_underlay(
-		struct resource_context *res_ctx,
-		struct core_stream *stream)
-{
-	if (!res_ctx->pipe_ctx[DCE110_UNDERLAY_IDX].stream) {
-		struct dc_bios *dcb;
-		struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[DCE110_UNDERLAY_IDX];
-
-		pipe_ctx->tg = res_ctx->pool.timing_generators[DCE110_UNDERLAY_IDX];
-		pipe_ctx->mi = res_ctx->pool.mis[DCE110_UNDERLAY_IDX];
-		/*pipe_ctx->ipp = res_ctx->pool.ipps[DCE110_UNDERLAY_IDX];*/
-		pipe_ctx->xfm = res_ctx->pool.transforms[DCE110_UNDERLAY_IDX];
-		pipe_ctx->opp = res_ctx->pool.opps[DCE110_UNDERLAY_IDX];
-		pipe_ctx->dis_clk = res_ctx->pool.display_clock;
-		pipe_ctx->pipe_idx = DCE110_UNDERLAY_IDX;
-
-		dcb = dal_adapter_service_get_bios_parser(
-						res_ctx->pool.adapter_srv);
-
-		stream->ctx->dc->hwss.enable_display_power_gating(
-			stream->ctx->dc->ctx,
-			DCE110_UNDERLAY_IDX,
-			dcb, PIPE_GATING_CONTROL_DISABLE);
-
-		if (!pipe_ctx->tg->funcs->set_blank(pipe_ctx->tg, true)) {
-			dm_error("DC: failed to blank crtc!\n");
-			BREAK_TO_DEBUGGER();
-		}
-
-		if (!pipe_ctx->tg->funcs->enable_crtc(pipe_ctx->tg)) {
-			BREAK_TO_DEBUGGER();
-		}
-
-		pipe_ctx->tg->funcs->set_blank_color(
-				pipe_ctx->tg,
-				COLOR_SPACE_YCBCR601);/* TODO unhardcode*/
-
-		pipe_ctx->stream = stream;
-		return DCE110_UNDERLAY_IDX;
-	}
-	return -1;
-}
-
-bool dc_commit_surfaces_to_target(
-		struct dc *dc,
-		struct dc_surface *new_surfaces[],
-		uint8_t new_surface_count,
-		struct dc_target *dc_target)
-
-{
-	int i, j;
-	uint32_t prev_disp_clk = dc->current_context.bw_results.dispclk_khz;
-	struct core_target *target = DC_TARGET_TO_CORE(dc_target);
-	struct dc_target_status *target_status = NULL;
-	struct validate_context *context;
-	int current_enabled_surface_count = 0;
-	int new_enabled_surface_count = 0;
-	bool is_mpo_turning_on = false;
-
-	context = dm_alloc(dc->ctx, sizeof(struct validate_context));
-
-	val_ctx_copy_construct(&dc->current_context, context);
-
-	/* Cannot commit surface to a target that is not commited */
-	for (i = 0; i < context->target_count; i++)
-		if (target == context->targets[i])
-			break;
-
-	target_status = &context->target_status[i];
-
-	if (!dal_adapter_service_is_in_accelerated_mode(
-						dc->res_pool.adapter_srv)
-		|| i == context->target_count) {
-		BREAK_TO_DEBUGGER();
-		goto unexpected_fail;
-	}
-
-	for (i = 0; i < target_status->surface_count; i++)
-		if (target_status->surfaces[i]->visible)
-			current_enabled_surface_count++;
-
-	for (i = 0; i < new_surface_count; i++)
-		if (new_surfaces[i]->visible)
-			new_enabled_surface_count++;
-
-	/* TODO unhack mpo */
-	if (new_surface_count == 2 && target_status->surface_count < 2) {
-		acquire_first_free_underlay(&context->res_ctx,
-				DC_STREAM_TO_CORE(dc_target->streams[0]));
-		is_mpo_turning_on = true;
-	} else if (new_surface_count < 2 && target_status->surface_count == 2) {
-		context->res_ctx.pipe_ctx[DCE110_UNDERLAY_IDX].stream = NULL;
-		context->res_ctx.pipe_ctx[DCE110_UNDERLAY_IDX].surface = NULL;
-	}
-
-	dal_logger_write(dc->ctx->logger,
-				LOG_MAJOR_INTERFACE_TRACE,
-				LOG_MINOR_COMPONENT_DC,
-				"%s: commit %d surfaces to target 0x%x\n",
-				__func__,
-				new_surface_count,
-				dc_target);
-
-
-	if (!attach_surfaces_to_context(
-			new_surfaces, new_surface_count, dc_target, context)) {
-		BREAK_TO_DEBUGGER();
-		goto unexpected_fail;
-	}
-
-	for (i = 0; i < new_surface_count; i++)
-		for (j = 0; j < MAX_PIPES; j++) {
-			if (context->res_ctx.pipe_ctx[j].surface !=
-					DC_SURFACE_TO_CORE(new_surfaces[i]))
-				continue;
-
-			build_scaling_params(
-				new_surfaces[i], &context->res_ctx.pipe_ctx[j]);
-		}
-
-	if (dc->res_pool.funcs->validate_bandwidth(dc, context) != DC_OK) {
-		BREAK_TO_DEBUGGER();
-		goto unexpected_fail;
-	}
-
-	if (prev_disp_clk < context->bw_results.dispclk_khz ||
-		(is_mpo_turning_on &&
-			prev_disp_clk == context->bw_results.dispclk_khz)) {
-		dc->hwss.program_bw(dc, context);
-		pplib_apply_display_requirements(dc, context,
-						&context->pp_display_cfg);
-	}
-
-	if (current_enabled_surface_count > 0 && new_enabled_surface_count == 0)
-		dc_target_disable_memory_requests(dc_target);
-
-	for (i = 0; i < new_surface_count; i++)
-		for (j = 0; j < MAX_PIPES; j++) {
-			struct dc_surface *dc_surface = new_surfaces[i];
-			struct core_surface *surface =
-						DC_SURFACE_TO_CORE(dc_surface);
-			struct pipe_ctx *pipe_ctx =
-						&context->res_ctx.pipe_ctx[j];
-			struct core_gamma *gamma = NULL;
-
-			if (pipe_ctx->surface !=
-					DC_SURFACE_TO_CORE(new_surfaces[i]))
-				continue;
-
-			dal_logger_write(dc->ctx->logger,
-						LOG_MAJOR_INTERFACE_TRACE,
-						LOG_MINOR_COMPONENT_DC,
-						"Pipe:%d 0x%x: src: %d, %d, %d,"
-						" %d; dst: %d, %d, %d, %d;\n",
-						pipe_ctx->pipe_idx,
-						dc_surface,
-						dc_surface->src_rect.x,
-						dc_surface->src_rect.y,
-						dc_surface->src_rect.width,
-						dc_surface->src_rect.height,
-						dc_surface->dst_rect.x,
-						dc_surface->dst_rect.y,
-						dc_surface->dst_rect.width,
-						dc_surface->dst_rect.height);
-
-			if (surface->public.gamma_correction)
-				gamma = DC_GAMMA_TO_CORE(
-					surface->public.gamma_correction);
-
-			dc->hwss.set_gamma_correction(
-					pipe_ctx->ipp,
-					pipe_ctx->opp,
-					gamma, surface);
-
-			dc->hwss.set_plane_config(
-				dc, pipe_ctx, &context->res_ctx);
-		}
-
-	dc->hwss.update_plane_addrs(dc, &context->res_ctx);
-
-	/* Lower display clock if necessary */
-	if (prev_disp_clk > context->bw_results.dispclk_khz) {
-		dc->hwss.program_bw(dc, context);
-		pplib_apply_display_requirements(dc, context,
-						&context->pp_display_cfg);
-	}
-
-	val_ctx_destruct(&dc->current_context);
-	dc->current_context = *context;
-	dm_free(dc->ctx, context);
-	return true;
-
-unexpected_fail:
-
-	val_ctx_destruct(context);
-
-	dm_free(dc->ctx, context);
-	return false;
-}
-
 bool dc_target_is_connected_to_sink(
 		const struct dc_target * dc_target,
 		const struct dc_sink *dc_sink)
@@ -372,52 +142,6 @@ bool dc_target_is_connected_to_sink(
 	return false;
 }
 
-void dc_target_enable_memory_requests(struct dc_target *dc_target)
-{
-	uint8_t i, j;
-	struct core_target *target = DC_TARGET_TO_CORE(dc_target);
-	struct resource_context *res_ctx =
-		&target->ctx->dc->current_context.res_ctx;
-
-	for (i = 0; i < target->public.stream_count; i++) {
-		for (j = 0; j < MAX_PIPES; j++) {
-			struct timing_generator *tg = res_ctx->pipe_ctx[j].tg;
-
-			if (res_ctx->pipe_ctx[j].stream !=
-				DC_STREAM_TO_CORE(target->public.streams[i]))
-				continue;
-
-			if (!tg->funcs->set_blank(tg, false)) {
-				dm_error("DC: failed to unblank crtc!\n");
-				BREAK_TO_DEBUGGER();
-			}
-		}
-	}
-}
-
-void dc_target_disable_memory_requests(struct dc_target *dc_target)
-{
-	uint8_t i, j;
-	struct core_target *target = DC_TARGET_TO_CORE(dc_target);
-	struct resource_context *res_ctx =
-		&target->ctx->dc->current_context.res_ctx;
-
-	for (i = 0; i < target->public.stream_count; i++) {
-		for (j = 0; j < MAX_PIPES; j++) {
-			struct timing_generator *tg = res_ctx->pipe_ctx[j].tg;
-
-			if (res_ctx->pipe_ctx[j].stream !=
-				DC_STREAM_TO_CORE(target->public.streams[i]))
-				continue;
-
-			if (!tg->funcs->set_blank(tg, true)) {
-				dm_error("DC: failed to blank crtc!\n");
-				BREAK_TO_DEBUGGER();
-			}
-		}
-	}
-}
-
 /**
  * Update the cursor attributes and set cursor surface address
  */
diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
index fb0b9f6..1290f3f 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc.h
@@ -235,9 +235,6 @@ enum dc_irq_source dc_target_get_irq_src(
 	const struct dc_target *dc_target,
 	const enum irq_type irq_type);
 
-void dc_target_enable_memory_requests(struct dc_target *target);
-void dc_target_disable_memory_requests(struct dc_target *target);
-
 /*
  * Structure to store surface/target associations for validation
  */
-- 
2.7.4