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

Commit 058c973e authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: dp: fix HDCP 1.x state transitions



Fix HDCP 1.x state transitions by ensuring that transitions to
authenticating state can be made from both an uninitialized and
a failure state, and making sure that authentication thread is
synchronously canceled before transitioning to a disabled
state.

CRs-Fixed: 2006096
Change-Id: Ic097e16451166f589acbd7c23f87bd9b4c1a65f3
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 0325fec7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3039,7 +3039,7 @@ static int mdss_dp_event_handler(struct mdss_panel_data *pdata,
		mdss_dp_update_hdcp_info(dp);

		if (dp_is_hdcp_enabled(dp)) {
			cancel_delayed_work(&dp->hdcp_cb_work);
			cancel_delayed_work_sync(&dp->hdcp_cb_work);

			dp->hdcp_status = HDCP_STATE_AUTHENTICATING;
			queue_delayed_work(dp->workq,
@@ -3059,7 +3059,7 @@ static int mdss_dp_event_handler(struct mdss_panel_data *pdata,
		if (dp_is_hdcp_enabled(dp)) {
			dp->hdcp_status = HDCP_STATE_INACTIVE;

			cancel_delayed_work(&dp->hdcp_cb_work);
			cancel_delayed_work_sync(&dp->hdcp_cb_work);
			if (dp->hdcp.ops->off)
				dp->hdcp.ops->off(dp->hdcp.data);
		}
@@ -3722,7 +3722,7 @@ static int mdss_dp_process_audio_pattern_request(struct mdss_dp_drv_pdata *dp)
		return -EINVAL;

	if (dp_is_hdcp_enabled(dp) && dp->hdcp.ops->off) {
		cancel_delayed_work(&dp->hdcp_cb_work);
		cancel_delayed_work_sync(&dp->hdcp_cb_work);
		dp->hdcp.ops->off(dp->hdcp.data);
	}

@@ -4029,7 +4029,7 @@ static void mdss_dp_process_attention(struct mdss_dp_drv_pdata *dp_drv)
		}

		if (dp_is_hdcp_enabled(dp_drv) && dp_drv->hdcp.ops->off) {
			cancel_delayed_work(&dp_drv->hdcp_cb_work);
			cancel_delayed_work_sync(&dp_drv->hdcp_cb_work);
			dp_drv->hdcp.ops->off(dp_drv->hdcp.data);
		}

+2 −2
Original line number Diff line number Diff line
@@ -1381,7 +1381,8 @@ int hdcp_1x_authenticate(void *input)

	flush_delayed_work(&hdcp->hdcp_auth_work);

	if (!hdcp_1x_state(HDCP_STATE_INACTIVE)) {
	if (!hdcp_1x_state(HDCP_STATE_INACTIVE) &&
			!hdcp_1x_state(HDCP_STATE_AUTH_FAIL)) {
		pr_err("invalid state\n");
		return -EINVAL;
	}
@@ -1443,7 +1444,6 @@ int hdcp_1x_reauthenticate(void *input)

	DSS_REG_W(io, reg_set->reset, reg & ~reg_set->reset_bit);

	hdcp->hdcp_state = HDCP_STATE_INACTIVE;
	hdcp_1x_authenticate(hdcp);

	return ret;