Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cd1837e authored by Sankeerth Billakanti's avatar Sankeerth Billakanti Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dp: turn off audio before dp lane status toggling



There is an audio turn off timeout error whenever DP handles
the link state toggling requests from sink during audio
playback session. The audio hw is waiting for DMA write done
interrupts before issuing a audio session tear down. As the
DP controller is put into reset before link training, the
DMA write done is not sent by the DP controller hence causing
audio timeout errors. These changes turn off audio before the
DP controller is put into reset so that the audio session
tear down takes place within the stipulated time.

Change-Id: I7b88d0385a84f308d8537c2766e6fbc25a2ddc3b
Signed-off-by: default avatarSankeerth Billakanti <sbillaka@codeaurora.org>
parent 5515f145
Loading
Loading
Loading
Loading
+45 −21
Original line number Diff line number Diff line
@@ -174,6 +174,31 @@ static bool dp_display_is_ready(struct dp_display_private *dp)
		dp->hpd->alt_mode_cfg_done;
}

static void dp_display_audio_enable(struct dp_display_private *dp, bool enable)
{
	struct dp_panel *dp_panel;
	int idx = 0;

	for (idx = DP_STREAM_0; idx < DP_STREAM_MAX; idx++) {
		if (!dp->active_panels[idx])
			continue;

		dp_panel = dp->active_panels[idx];

		if (dp_panel->audio_supported) {
			if (enable) {
				dp_panel->audio->bw_code =
					dp->link->link_params.bw_code;
				dp_panel->audio->lane_count =
					dp->link->link_params.lane_count;
				dp_panel->audio->on(dp_panel->audio);
			} else {
				dp_panel->audio->off(dp_panel->audio);
			}
		}
	}
}

static void dp_display_update_hdcp_status(struct dp_display_private *dp,
					bool reset)
{
@@ -815,8 +840,7 @@ static void dp_display_process_mst_hpd_low(struct dp_display_private *dp)

static int dp_display_process_hpd_low(struct dp_display_private *dp)
{
	int rc = 0, idx;
	struct dp_panel *dp_panel;
	int rc = 0;
	struct dp_link_hdcp_status *status;

	mutex_lock(&dp->session_lock);
@@ -834,15 +858,7 @@ static int dp_display_process_hpd_low(struct dp_display_private *dp)
		dp_display_update_hdcp_status(dp, true);
	}

	for (idx = DP_STREAM_0; idx < DP_STREAM_MAX; idx++) {
		if (!dp->active_panels[idx])
			continue;

		dp_panel = dp->active_panels[idx];

		if (dp_panel->audio_supported)
			dp_panel->audio->off(dp_panel->audio);
	}
	dp_display_audio_enable(dp, false);

	mutex_unlock(&dp->session_lock);

@@ -1098,19 +1114,27 @@ static void dp_display_attention_work(struct work_struct *work)
		goto mst_attention;
	}

	if ((dp->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) ||
			(dp->link->sink_request & DP_TEST_LINK_TRAINING) ||
			(dp->link->sink_request & DP_LINK_STATUS_UPDATED)) {
		mutex_lock(&dp->session_lock);
		dp_display_audio_enable(dp, false);
		mutex_unlock(&dp->session_lock);

		if (dp->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) {
			dp->ctrl->process_phy_test_request(dp->ctrl);
		goto mst_attention;
	}

	if (dp->link->sink_request & DP_TEST_LINK_TRAINING) {
		} else if (dp->link->sink_request & DP_TEST_LINK_TRAINING) {
			dp->link->send_test_response(dp->link);
			dp->ctrl->link_maintenance(dp->ctrl);
		goto mst_attention;
		} else if (dp->link->sink_request & DP_LINK_STATUS_UPDATED) {
			dp->ctrl->link_maintenance(dp->ctrl);
		}

	if (dp->link->sink_request & DP_LINK_STATUS_UPDATED)
		dp->ctrl->link_maintenance(dp->ctrl);
		mutex_lock(&dp->session_lock);
		dp_display_audio_enable(dp, true);
		mutex_unlock(&dp->session_lock);
		goto mst_attention;
	}
cp_irq:
	if (dp_display_is_hdcp_enabled(dp) && dp->hdcp.ops->cp_irq)
		dp->hdcp.ops->cp_irq(dp->hdcp.data);