Blob Blame History Raw
From: Wenjing Liu <Wenjing.Liu@amd.com>
Date: Thu, 17 Aug 2017 16:24:11 -0400
Subject: drm/amd/display: re-enable audio after LT test
Git-commit: 3005e437e70fd4d1da64d91b4ef027f62d3b9a41
Patch-mainline: v4.15-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

[Description]
Audio should be attached to the same pipe once it is attached.
We will not remove audio endpoint in disable stream.
We will reeanble the audio after automated link training test

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c          |   14 ++++++++++++
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c |    2 -
 2 files changed, 14 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
@@ -310,6 +310,20 @@ void dp_retrain_link_dp_test(struct dc_l
 
 			link->dc->hwss.unblank_stream(&pipes[i],
 					link_setting);
+
+			if (pipes[i].stream_res.audio) {
+				/* notify audio driver for
+				 * audio modes of monitor */
+				pipes[i].stream_res.audio->funcs->az_enable(
+						pipes[i].stream_res.audio);
+
+				/* un-mute audio */
+				/* TODO: audio should be per stream rather than
+				 * per link */
+				pipes[i].stream_res.stream_enc->funcs->
+				audio_mute_control(
+					pipes[i].stream_res.stream_enc, false);
+			}
 		}
 	}
 }
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -758,8 +758,6 @@ void dce110_disable_stream(struct pipe_c
 			pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_disable(
 					pipe_ctx->stream_res.stream_enc);
 
-		pipe_ctx->stream_res.audio = NULL;
-
 		/* TODO: notify audio driver for if audio modes list changed
 		 * add audio mode list change flag */
 		/* dal_audio_disable_azalia_audio_jack_presence(stream->audio,