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

Commit 171aa9cc authored by Christopher Braga's avatar Christopher Braga
Browse files

drm/msm/hdcp: Account for in progress stream management



If stream registration is invoked while HDCP is still authenticating,
the new stream information may not get sent to the downstream repeater.

Check if stream management is already in progress during stream
registration, and queue another round of stream management if so.

Change-Id: I497e9a4da310870fe792293033f1fb0ce8fbee4c
Signed-off-by: default avatarChristopher Braga <cbraga@codeaurora.org>
parent efa8399e
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ static int sde_hdcp_2x_get_next_message(struct sde_hdcp_2x_ctrl *hdcp,
	case REP_SEND_RECV_ID_LIST:
		return REP_SEND_ACK;
	case REP_STREAM_MANAGE:
		hdcp->resend_stream_manage = false;
		return REP_STREAM_READY;
	default:
		pr_err("Uknown message ID (%d)", hdcp->last_msg);
@@ -734,7 +735,15 @@ static void sde_hdcp_2x_msg_recvd(struct sde_hdcp_2x_ctrl *hdcp)
			sde_hdcp_2x_message_name(out_msg));

	if (msg[0] == REP_STREAM_READY && out_msg != REP_STREAM_MANAGE) {
		if (!hdcp->authenticated) {
		if (hdcp->resend_stream_manage) {
			pr_debug("resend stream management\n");
			rc = hdcp2_app_comm(hdcp->hdcp2_ctx,
					HDCP2_CMD_QUERY_STREAM,
					&hdcp->app_data);
			if (!rc)
				sde_hdcp_2x_send_message(hdcp);
			goto exit;
		} else if (!hdcp->authenticated) {
			rc = hdcp2_app_comm(hdcp->hdcp2_ctx,
					HDCP2_CMD_EN_ENCRYPTION,
					&hdcp->app_data);
@@ -887,8 +896,14 @@ static void sde_hdcp_2x_manage_stream_work(struct kthread_work *work)
		}
	}

	if (query_streams && hdcp->authenticated)
	if (query_streams) {
		if (hdcp->authenticated) {
			HDCP_2X_EXECUTE(stream);
		} else if (hdcp->last_msg == REP_STREAM_MANAGE ||
				hdcp->last_msg == REP_STREAM_READY) {
			hdcp->resend_stream_manage = true;
		}
	}
}

static bool sde_remove_streams(struct sde_hdcp_2x_ctrl *hdcp,