From 7893b22bd257b2a5b029c1952e17c698d029b770 Mon Sep 17 00:00:00 2001 From: Christopher Braga Date: Mon, 22 Apr 2019 16:30:44 -0400 Subject: [PATCH] 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 --- msm/sde_hdcp_2x.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/msm/sde_hdcp_2x.c b/msm/sde_hdcp_2x.c index d54b3961d2..c4f7c210d0 100644 --- a/msm/sde_hdcp_2x.c +++ b/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; + } + } }