aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1057-drm-amd-dal-Fix-wrong-audio-clock-after-resume.patch
blob: df4f3f1f74a4ad3a4deed1bf9f1f00e0e5d346b9 (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
From 0f34627fec7c6c6f955ed9719e9f2edf30ad87e5 Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Wed, 20 Apr 2016 12:08:03 -0400
Subject: [PATCH 1057/1110] drm/amd/dal: Fix wrong audio clock after resume

Don't call build_audio_output during validation since it
reads clock registers to determine the audio dto values.

Move build_audio_output to end of set_mode to make sure pixel
clock has been programmed.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    |  93 ---------------
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    | 130 ++++++++++++++++++---
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    |  88 --------------
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    |  89 --------------
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c  |  89 --------------
 drivers/gpu/drm/amd/dal/dc/inc/core_types.h        |   1 -
 6 files changed, 113 insertions(+), 377 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
index 4820af7..e2b71ba 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
@@ -573,97 +573,6 @@ void dce100_destruct_resource_pool(struct resource_pool *pool)
 		dal_adapter_service_destroy(&pool->adapter_srv);
 }
 
-static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id)
-{
-	switch (crtc_id) {
-	case CONTROLLER_ID_D0:
-		return DTO_SOURCE_ID0;
-	case CONTROLLER_ID_D1:
-		return DTO_SOURCE_ID1;
-	case CONTROLLER_ID_D2:
-		return DTO_SOURCE_ID2;
-	case CONTROLLER_ID_D3:
-		return DTO_SOURCE_ID3;
-	case CONTROLLER_ID_D4:
-		return DTO_SOURCE_ID4;
-	case CONTROLLER_ID_D5:
-		return DTO_SOURCE_ID5;
-	default:
-		return DTO_SOURCE_UNKNOWN;
-	}
-}
-
-static void build_audio_output(
-	const struct pipe_ctx *pipe_ctx,
-	struct audio_output *audio_output)
-{
-	const struct core_stream *stream = pipe_ctx->stream;
-	audio_output->engine_id = pipe_ctx->stream_enc->id;
-
-	audio_output->signal = pipe_ctx->signal;
-
-	/* audio_crtc_info  */
-
-	audio_output->crtc_info.h_total =
-		stream->public.timing.h_total;
-
-	/*
-	 * Audio packets are sent during actual CRTC blank physical signal, we
-	 * need to specify actual active signal portion
-	 */
-	audio_output->crtc_info.h_active =
-			stream->public.timing.h_addressable
-			+ stream->public.timing.h_border_left
-			+ stream->public.timing.h_border_right;
-
-	audio_output->crtc_info.v_active =
-			stream->public.timing.v_addressable
-			+ stream->public.timing.v_border_top
-			+ stream->public.timing.v_border_bottom;
-
-	audio_output->crtc_info.pixel_repetition = 1;
-
-	audio_output->crtc_info.interlaced =
-			stream->public.timing.flags.INTERLACE;
-
-	audio_output->crtc_info.refresh_rate =
-		(stream->public.timing.pix_clk_khz*1000)/
-		(stream->public.timing.h_total*stream->public.timing.v_total);
-
-	audio_output->crtc_info.color_depth =
-		stream->public.timing.display_color_depth;
-
-	audio_output->crtc_info.requested_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	/*
-	 * TODO - Investigate why calculated pixel clk has to be
-	 * requested pixel clk
-	 */
-	audio_output->crtc_info.calculated_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	if (pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT ||
-			pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
-		audio_output->pll_info.dp_dto_source_clock_in_khz =
-			dal_display_clock_get_dp_ref_clk_frequency(
-				pipe_ctx->dis_clk);
-	}
-
-	audio_output->pll_info.feed_back_divider =
-			pipe_ctx->pll_settings.feedback_divider;
-
-	audio_output->pll_info.dto_source =
-		translate_to_dto_source(
-			pipe_ctx->pipe_idx + 1);
-
-	/* TODO hard code to enable for now. Need get from stream */
-	audio_output->pll_info.ss_enabled = true;
-
-	audio_output->pll_info.ss_percentage =
-			pipe_ctx->pll_settings.ss_percentage;
-}
-
 static void get_pixel_clock_parameters(
 	const struct pipe_ctx *pipe_ctx,
 	struct pixel_clk_params *pixel_clk_params)
@@ -690,8 +599,6 @@ static enum dc_status build_pipe_hw_param(struct pipe_ctx *pipe_ctx)
 		&pipe_ctx->pix_clk_params,
 		&pipe_ctx->pll_settings);
 
-	build_audio_output(pipe_ctx, &pipe_ctx->audio_output);
-
 	return DC_OK;
 }
 
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 d1dd0d5..265617d 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
@@ -668,6 +668,97 @@ static enum dc_color_space get_output_color_space(
 	return color_space;
 }
 
+static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id)
+{
+	switch (crtc_id) {
+	case CONTROLLER_ID_D0:
+		return DTO_SOURCE_ID0;
+	case CONTROLLER_ID_D1:
+		return DTO_SOURCE_ID1;
+	case CONTROLLER_ID_D2:
+		return DTO_SOURCE_ID2;
+	case CONTROLLER_ID_D3:
+		return DTO_SOURCE_ID3;
+	case CONTROLLER_ID_D4:
+		return DTO_SOURCE_ID4;
+	case CONTROLLER_ID_D5:
+		return DTO_SOURCE_ID5;
+	default:
+		return DTO_SOURCE_UNKNOWN;
+	}
+}
+
+static void build_audio_output(
+	const struct pipe_ctx *pipe_ctx,
+	struct audio_output *audio_output)
+{
+	const struct core_stream *stream = pipe_ctx->stream;
+	audio_output->engine_id = pipe_ctx->stream_enc->id;
+
+	audio_output->signal = pipe_ctx->signal;
+
+	/* audio_crtc_info  */
+
+	audio_output->crtc_info.h_total =
+		stream->public.timing.h_total;
+
+	/*
+	 * Audio packets are sent during actual CRTC blank physical signal, we
+	 * need to specify actual active signal portion
+	 */
+	audio_output->crtc_info.h_active =
+			stream->public.timing.h_addressable
+			+ stream->public.timing.h_border_left
+			+ stream->public.timing.h_border_right;
+
+	audio_output->crtc_info.v_active =
+			stream->public.timing.v_addressable
+			+ stream->public.timing.v_border_top
+			+ stream->public.timing.v_border_bottom;
+
+	audio_output->crtc_info.pixel_repetition = 1;
+
+	audio_output->crtc_info.interlaced =
+			stream->public.timing.flags.INTERLACE;
+
+	audio_output->crtc_info.refresh_rate =
+		(stream->public.timing.pix_clk_khz*1000)/
+		(stream->public.timing.h_total*stream->public.timing.v_total);
+
+	audio_output->crtc_info.color_depth =
+		stream->public.timing.display_color_depth;
+
+	audio_output->crtc_info.requested_pixel_clock =
+			pipe_ctx->pix_clk_params.requested_pix_clk;
+
+	/*
+	 * TODO - Investigate why calculated pixel clk has to be
+	 * requested pixel clk
+	 */
+	audio_output->crtc_info.calculated_pixel_clock =
+			pipe_ctx->pix_clk_params.requested_pix_clk;
+
+	if (pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT ||
+			pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
+		audio_output->pll_info.dp_dto_source_clock_in_khz =
+			dal_display_clock_get_dp_ref_clk_frequency(
+				pipe_ctx->dis_clk);
+	}
+
+	audio_output->pll_info.feed_back_divider =
+			pipe_ctx->pll_settings.feedback_divider;
+
+	audio_output->pll_info.dto_source =
+		translate_to_dto_source(
+			pipe_ctx->pipe_idx + 1);
+
+	/* TODO hard code to enable for now. Need get from stream */
+	audio_output->pll_info.ss_enabled = true;
+
+	audio_output->pll_info.ss_percentage =
+			pipe_ctx->pll_settings.ss_percentage;
+}
+
 static enum dc_status apply_single_controller_ctx_to_hw(
 		struct pipe_ctx *pipe_ctx,
 		struct validate_context *context,
@@ -679,7 +770,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 			pipe_ctx[pipe_ctx->pipe_idx];
 
 	if (!pipe_ctx_old->stream) {
-		/* Must blank CRTC after disabling power gating and before any
+		/*
+		 * Must blank CRTC after disabling power gating and before any
 		 * programming, otherwise CRTC will be hung in bad state
 		 */
 		pipe_ctx->tg->funcs->set_blank(pipe_ctx->tg, true);
@@ -751,16 +843,6 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 			(pipe_ctx->signal == SIGNAL_TYPE_DVI_DUAL_LINK) ?
 			true : false);
 
-	if (pipe_ctx->audio != NULL) {
-		if (AUDIO_RESULT_OK != dal_audio_setup(
-				pipe_ctx->audio,
-				&pipe_ctx->audio_output,
-				&stream->public.audio_info)) {
-			BREAK_TO_DEBUGGER();
-			return DC_ERROR_UNEXPECTED;
-		}
-	}
-
 	/* program blank color */
 	color_space = get_output_color_space(&stream->public.timing);
 	pipe_ctx->tg->funcs->set_blank_color(
@@ -1163,6 +1245,7 @@ static enum dc_status apply_ctx_to_hw(
 {
 	enum dc_status status;
 	uint8_t i;
+	bool programmed_audio_dto = false;
 
 	/* Reset old context */
 	/* look up the targets that have been removed since last commit */
@@ -1257,12 +1340,25 @@ static enum dc_status apply_ctx_to_hw(
 	 */
 	for (i = 0; i < MAX_PIPES; i++) {
 		if (context->res_ctx.pipe_ctx[i].audio != NULL) {
-			dal_audio_setup_audio_wall_dto(
-					context->res_ctx.pipe_ctx[i].audio,
-					context->res_ctx.pipe_ctx[i].signal,
-					&context->res_ctx.pipe_ctx[i].audio_output.crtc_info,
-					&context->res_ctx.pipe_ctx[i].audio_output.pll_info);
-			break;
+			struct audio_output audio_output;
+			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
+
+			build_audio_output(pipe_ctx, &audio_output);
+			if (AUDIO_RESULT_OK != dal_audio_setup(
+					pipe_ctx->audio,
+					&audio_output,
+					&pipe_ctx->stream->public.audio_info)) {
+				BREAK_TO_DEBUGGER();
+				return DC_ERROR_UNEXPECTED;
+			}
+			if (!programmed_audio_dto) {
+				dal_audio_setup_audio_wall_dto(
+					pipe_ctx->audio,
+					pipe_ctx->signal,
+					&audio_output.crtc_info,
+					&audio_output.pll_info);
+				programmed_audio_dto = true;
+			}
 		}
 	}
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
index cf3a6ed..903d020 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
@@ -523,92 +523,6 @@ void dce110_destruct_resource_pool(struct resource_pool *pool)
 	}
 }
 
-static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id)
-{
-	switch (crtc_id) {
-	case CONTROLLER_ID_D0:
-		return DTO_SOURCE_ID0;
-	case CONTROLLER_ID_D1:
-		return DTO_SOURCE_ID1;
-	case CONTROLLER_ID_D2:
-		return DTO_SOURCE_ID2;
-	case CONTROLLER_ID_D3:
-		return DTO_SOURCE_ID3;
-	case CONTROLLER_ID_D4:
-		return DTO_SOURCE_ID4;
-	case CONTROLLER_ID_D5:
-		return DTO_SOURCE_ID5;
-	default:
-		return DTO_SOURCE_UNKNOWN;
-	}
-}
-
-static void build_audio_output(
-	const struct pipe_ctx *pipe_ctx,
-	struct audio_output *audio_output)
-{
-	const struct core_stream *stream = pipe_ctx->stream;
-	audio_output->engine_id = pipe_ctx->stream_enc->id;
-
-	audio_output->signal = pipe_ctx->signal;
-
-	/* audio_crtc_info  */
-
-	audio_output->crtc_info.h_total =
-		stream->public.timing.h_total;
-
-	/* Audio packets are sent during actual CRTC blank physical signal, we
-	 * need to specify actual active signal portion */
-	audio_output->crtc_info.h_active =
-			stream->public.timing.h_addressable
-			+ stream->public.timing.h_border_left
-			+ stream->public.timing.h_border_right;
-
-	audio_output->crtc_info.v_active =
-			stream->public.timing.v_addressable
-			+ stream->public.timing.v_border_top
-			+ stream->public.timing.v_border_bottom;
-
-	audio_output->crtc_info.pixel_repetition = 1;
-
-	audio_output->crtc_info.interlaced =
-			stream->public.timing.flags.INTERLACE;
-
-	audio_output->crtc_info.refresh_rate =
-		(stream->public.timing.pix_clk_khz*1000)/
-		(stream->public.timing.h_total*stream->public.timing.v_total);
-
-	audio_output->crtc_info.color_depth =
-		stream->public.timing.display_color_depth;
-
-	audio_output->crtc_info.requested_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	/* TODO - Investigate why calculated pixel clk has to be
-	 * requested pixel clk */
-	audio_output->crtc_info.calculated_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	if (pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT ||
-			pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
-		audio_output->pll_info.dp_dto_source_clock_in_khz =
-			dal_display_clock_get_dp_ref_clk_frequency(
-				pipe_ctx->dis_clk);
-	}
-
-	audio_output->pll_info.feed_back_divider =
-			pipe_ctx->pll_settings.feedback_divider;
-
-	audio_output->pll_info.dto_source =
-		translate_to_dto_source(
-			pipe_ctx->pipe_idx + 1);
-
-	/* TODO hard code to enable for now. Need get from stream */
-	audio_output->pll_info.ss_enabled = true;
-
-	audio_output->pll_info.ss_percentage =
-			pipe_ctx->pll_settings.ss_percentage;
-}
 
 static void get_pixel_clock_parameters(
 	const struct pipe_ctx *pipe_ctx,
@@ -636,8 +550,6 @@ static enum dc_status build_pipe_hw_param(struct pipe_ctx *pipe_ctx)
 		&pipe_ctx->pix_clk_params,
 		&pipe_ctx->pll_settings);
 
-	build_audio_output(pipe_ctx, &pipe_ctx->audio_output);
-
 	return DC_OK;
 }
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
index 4759a41..dd185af 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
@@ -616,93 +616,6 @@ static struct clock_source *find_matching_pll(struct resource_context *res_ctx,
 	return 0;
 }
 
-static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id)
-{
-	switch (crtc_id) {
-	case CONTROLLER_ID_D0:
-		return DTO_SOURCE_ID0;
-	case CONTROLLER_ID_D1:
-		return DTO_SOURCE_ID1;
-	case CONTROLLER_ID_D2:
-		return DTO_SOURCE_ID2;
-	case CONTROLLER_ID_D3:
-		return DTO_SOURCE_ID3;
-	case CONTROLLER_ID_D4:
-		return DTO_SOURCE_ID4;
-	case CONTROLLER_ID_D5:
-		return DTO_SOURCE_ID5;
-	default:
-		return DTO_SOURCE_UNKNOWN;
-	}
-}
-
-static void build_audio_output(
-	const struct pipe_ctx *pipe_ctx,
-	struct audio_output *audio_output)
-{
-	const struct core_stream *stream = pipe_ctx->stream;
-	audio_output->engine_id = pipe_ctx->stream_enc->id;
-
-	audio_output->signal = pipe_ctx->signal;
-
-	/* audio_crtc_info  */
-
-	audio_output->crtc_info.h_total =
-		stream->public.timing.h_total;
-
-	/* Audio packets are sent during actual CRTC blank physical signal, we
-	 * need to specify actual active signal portion */
-	audio_output->crtc_info.h_active =
-			stream->public.timing.h_addressable
-			+ stream->public.timing.h_border_left
-			+ stream->public.timing.h_border_right;
-
-	audio_output->crtc_info.v_active =
-			stream->public.timing.v_addressable
-			+ stream->public.timing.v_border_top
-			+ stream->public.timing.v_border_bottom;
-
-	audio_output->crtc_info.pixel_repetition = 1;
-
-	audio_output->crtc_info.interlaced =
-			stream->public.timing.flags.INTERLACE;
-
-	audio_output->crtc_info.refresh_rate =
-		(stream->public.timing.pix_clk_khz*1000)/
-		(stream->public.timing.h_total*stream->public.timing.v_total);
-
-	audio_output->crtc_info.color_depth =
-		stream->public.timing.display_color_depth;
-
-	audio_output->crtc_info.requested_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	/* TODO - Investigate why calculated pixel clk has to be
-	 * requested pixel clk */
-	audio_output->crtc_info.calculated_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	if (pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT ||
-			pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
-		audio_output->pll_info.dp_dto_source_clock_in_khz =
-			dal_display_clock_get_dp_ref_clk_frequency(
-				pipe_ctx->dis_clk);
-	}
-
-	audio_output->pll_info.feed_back_divider =
-			pipe_ctx->pll_settings.feedback_divider;
-
-	audio_output->pll_info.dto_source =
-		translate_to_dto_source(
-			pipe_ctx->pipe_idx + 1);
-
-	/* TODO hard code to enable for now. Need get from stream */
-	audio_output->pll_info.ss_enabled = true;
-
-	audio_output->pll_info.ss_percentage =
-			pipe_ctx->pll_settings.ss_percentage;
-}
-
 static void get_pixel_clock_parameters(
 	const struct pipe_ctx *pipe_ctx,
 	struct pixel_clk_params *pixel_clk_params)
@@ -729,8 +642,6 @@ static enum dc_status build_pipe_hw_param(struct pipe_ctx *pipe_ctx)
 		&pipe_ctx->pix_clk_params,
 		&pipe_ctx->pll_settings);
 
-	build_audio_output(pipe_ctx, &pipe_ctx->audio_output);
-
 	return DC_OK;
 }
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c
index b2aa2cc..c52739c 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c
@@ -534,93 +534,6 @@ void dce80_destruct_resource_pool(struct resource_pool *pool)
 	}
 }
 
-static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id)
-{
-	switch (crtc_id) {
-	case CONTROLLER_ID_D0:
-		return DTO_SOURCE_ID0;
-	case CONTROLLER_ID_D1:
-		return DTO_SOURCE_ID1;
-	case CONTROLLER_ID_D2:
-		return DTO_SOURCE_ID2;
-	case CONTROLLER_ID_D3:
-		return DTO_SOURCE_ID3;
-	case CONTROLLER_ID_D4:
-		return DTO_SOURCE_ID4;
-	case CONTROLLER_ID_D5:
-		return DTO_SOURCE_ID5;
-	default:
-		return DTO_SOURCE_UNKNOWN;
-	}
-}
-
-static void build_audio_output(
-	const struct pipe_ctx *pipe_ctx,
-	struct audio_output *audio_output)
-{
-	const struct core_stream *stream = pipe_ctx->stream;
-	audio_output->engine_id = pipe_ctx->stream_enc->id;
-
-	audio_output->signal = pipe_ctx->signal;
-
-	/* audio_crtc_info  */
-
-	audio_output->crtc_info.h_total =
-		stream->public.timing.h_total;
-
-	/* Audio packets are sent during actual CRTC blank physical signal, we
-	 * need to specify actual active signal portion */
-	audio_output->crtc_info.h_active =
-			stream->public.timing.h_addressable
-			+ stream->public.timing.h_border_left
-			+ stream->public.timing.h_border_right;
-
-	audio_output->crtc_info.v_active =
-			stream->public.timing.v_addressable
-			+ stream->public.timing.v_border_top
-			+ stream->public.timing.v_border_bottom;
-
-	audio_output->crtc_info.pixel_repetition = 1;
-
-	audio_output->crtc_info.interlaced =
-			stream->public.timing.flags.INTERLACE;
-
-	audio_output->crtc_info.refresh_rate =
-		(stream->public.timing.pix_clk_khz*1000)/
-		(stream->public.timing.h_total*stream->public.timing.v_total);
-
-	audio_output->crtc_info.color_depth =
-		stream->public.timing.display_color_depth;
-
-	audio_output->crtc_info.requested_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	/* TODO - Investigate why calculated pixel clk has to be
-	 * requested pixel clk */
-	audio_output->crtc_info.calculated_pixel_clock =
-			pipe_ctx->pix_clk_params.requested_pix_clk;
-
-	if (pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT ||
-			pipe_ctx->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
-		audio_output->pll_info.dp_dto_source_clock_in_khz =
-			dal_display_clock_get_dp_ref_clk_frequency(
-				pipe_ctx->dis_clk);
-	}
-
-	audio_output->pll_info.feed_back_divider =
-			pipe_ctx->pll_settings.feedback_divider;
-
-	audio_output->pll_info.dto_source =
-		translate_to_dto_source(
-			pipe_ctx->pipe_idx + 1);
-
-	/* TODO hard code to enable for now. Need get from stream */
-	audio_output->pll_info.ss_enabled = true;
-
-	audio_output->pll_info.ss_percentage =
-			pipe_ctx->pll_settings.ss_percentage;
-}
-
 static void get_pixel_clock_parameters(
 	const struct pipe_ctx *pipe_ctx,
 	struct pixel_clk_params *pixel_clk_params)
@@ -647,8 +560,6 @@ static enum dc_status build_pipe_hw_param(struct pipe_ctx *pipe_ctx)
 		&pipe_ctx->pix_clk_params,
 		&pipe_ctx->pll_settings);
 
-	build_audio_output(pipe_ctx, &pipe_ctx->audio_output);
-
 	return DC_OK;
 }
 
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 94e0adf..ef6ce30 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
@@ -279,7 +279,6 @@ struct pipe_ctx {
 	struct clock_source *clock_source;
 
 	struct audio *audio;
-	struct audio_output audio_output;
 
 	enum signal_type signal;
 
-- 
2.7.4