[39/39] drm/amd/dal: Configure audio before audio enable (Jack presence Hot Plug)

Submitted by Harry Wentland on Nov. 24, 2016, 2:03 a.m.

Details

Message ID 20161124020308.28124-40-harry.wentland@amd.com
State New
Headers show
Series "dal patches for nov 23, 2016" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Harry Wentland Nov. 24, 2016, 2:03 a.m.
From: Reza Amini <reza.amini@amd.com>

Change-Id: Iec19ac35466f0762f305d167e961d72543f58ef7
Signed-off-by: Reza Amini <reza.amini@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    | 48 +++++++++++-----------
 1 file changed, 23 insertions(+), 25 deletions(-)

Patch hide | download patch | download mbox

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 484840efe58d..1a682996b531 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
@@ -1284,32 +1284,22 @@  enum dc_status dce110_apply_ctx_to_hw(
 		if (pipe_ctx->top_pipe)
 			continue;
 
-		status = apply_single_controller_ctx_to_hw(
-				pipe_ctx,
-				context,
-				dc);
-
-		if (DC_OK != status)
-			return status;
-	}
-
-	/* Setup audio rate clock source */
-	/* Issue:
-	 * Audio lag happened on DP monitor when unplug a HDMI monitor
-	 *
-	 * Cause:
-	 * In case of DP and HDMI connected or HDMI only, DCCG_AUDIO_DTO_SEL
-	 * is set to either dto0 or dto1, audio should work fine.
-	 * In case of DP connected only, DCCG_AUDIO_DTO_SEL should be dto1,
-	 * set to dto0 will cause audio lag.
-	 *
-	 * Solution:
-	 * Not optimized audio wall dto setup. When mode set, iterate pipe_ctx,
-	 * find first available pipe with audio, setup audio wall DTO per topology
-	 * instead of per pipe.
-	 */
-	for (i = 0; i < context->res_ctx.pool->pipe_count; i++) {
 		if (context->res_ctx.pipe_ctx[i].audio != NULL) {
+			/* Setup audio rate clock source */
+			/* Issue:
+			* Audio lag happened on DP monitor when unplug a HDMI monitor
+			*
+			* Cause:
+			* In case of DP and HDMI connected or HDMI only, DCCG_AUDIO_DTO_SEL
+			* is set to either dto0 or dto1, audio should work fine.
+			* In case of DP connected only, DCCG_AUDIO_DTO_SEL should be dto1,
+			* set to dto0 will cause audio lag.
+			*
+			* Solution:
+			* Not optimized audio wall dto setup. When mode set, iterate pipe_ctx,
+			* find first available pipe with audio, setup audio wall DTO per topology
+			* instead of per pipe.
+			*/
 			struct audio_output audio_output;
 			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
 
@@ -1342,6 +1332,14 @@  enum dc_status dce110_apply_ctx_to_hw(
 				programmed_audio_dto = true;
 			}
 		}
+
+		status = apply_single_controller_ctx_to_hw(
+				pipe_ctx,
+				context,
+				dc);
+
+		if (DC_OK != status)
+			return status;
 	}
 
 	dc->hwss.set_displaymarks(dc, context);