Bläddra i källkod

disp: msm: 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: Christopher Braga <[email protected]>
Christopher Braga 6 år sedan
förälder
incheckning
7893b22bd2
1 ändrade filer med 12 tillägg och 3 borttagningar
  1. 12 3
      msm/sde_hdcp_2x.c

+ 12 - 3
msm/sde_hdcp_2x.c

@@ -193,6 +193,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("Unknown message ID (%d)\n", hdcp->last_msg);
@@ -602,7 +603,9 @@ static void sde_hdcp_2x_msg_recvd(struct sde_hdcp_2x_ctrl *hdcp)
 	pr_debug("[tz]: %s\n", 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");
+		} else if (!hdcp->authenticated) {
 			rc = hdcp2_app_comm(hdcp->hdcp2_ctx,
 					HDCP2_CMD_EN_ENCRYPTION,
 					&hdcp->app_data);
@@ -712,8 +715,14 @@ static void sde_hdcp_2x_manage_stream(struct sde_hdcp_2x_ctrl *hdcp)
 		}
 	}
 
-	if (query_streams && hdcp->authenticated)
-		sde_hdcp_2x_query_stream(hdcp);
+	if (query_streams) {
+		if (hdcp->authenticated) {
+			sde_hdcp_2x_query_stream(hdcp);
+		} else if (hdcp->last_msg == REP_STREAM_MANAGE ||
+				hdcp->last_msg == REP_STREAM_READY) {
+			hdcp->resend_stream_manage = true;
+		}
+	}
 }