Browse Source

Merge "disp: msm: dp: modify handling of CP_IRQ to fix HDCP 2.3 CTS test 1B-09"

qctecmdr 4 years ago
parent
commit
b581ca2910
1 changed files with 26 additions and 6 deletions
  1. 26 6
      msm/dp/dp_hdcp2p2.c

+ 26 - 6
msm/dp/dp_hdcp2p2.c

@@ -570,7 +570,7 @@ static void dp_hdcp2p2_recv_msg(struct dp_hdcp2p2_ctrl *ctrl)
 
 
 static void dp_hdcp2p2_link_check(struct dp_hdcp2p2_ctrl *ctrl)
 static void dp_hdcp2p2_link_check(struct dp_hdcp2p2_ctrl *ctrl)
 {
 {
-	int rc = 0, retries = 10;
+	int rc = 0;
 	struct sde_hdcp_2x_wakeup_data cdata = {HDCP_2X_CMD_INVALID};
 	struct sde_hdcp_2x_wakeup_data cdata = {HDCP_2X_CMD_INVALID};
 
 
 	if (!ctrl) {
 	if (!ctrl) {
@@ -603,10 +603,6 @@ static void dp_hdcp2p2_link_check(struct dp_hdcp2p2_ctrl *ctrl)
 		goto exit;
 		goto exit;
 	}
 	}
 
 
-	/* wait for polling to start till spec allowed timeout */
-	while (!ctrl->polling && retries--)
-		msleep(20);
-
 	/* check if sink has made a message available */
 	/* check if sink has made a message available */
 	if (ctrl->polling && (ctrl->sink_rx_status & ctrl->rx_status)) {
 	if (ctrl->polling && (ctrl->sink_rx_status & ctrl->rx_status)) {
 		ctrl->sink_rx_status = 0;
 		ctrl->sink_rx_status = 0;
@@ -673,7 +669,7 @@ error:
 
 
 static int dp_hdcp2p2_cp_irq(void *input)
 static int dp_hdcp2p2_cp_irq(void *input)
 {
 {
-	int rc;
+	int rc, retries = 15;
 	struct dp_hdcp2p2_ctrl *ctrl = input;
 	struct dp_hdcp2p2_ctrl *ctrl = input;
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY);
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY);
 
 
@@ -701,7 +697,31 @@ static int dp_hdcp2p2_cp_irq(void *input)
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
+	/*
+	 * Wait for link to be transitioned to polling mode. This wait
+	 * should be done in this CP_IRQ handler and NOT in the event thread
+	 * as the transition to link polling happens in the event thread
+	 * as part of the wake up from the HDCP engine.
+	 *
+	 * One specific case where this sequence of event commonly happens
+	 * is when executing HDCP 2.3 CTS test 1B-09 with Unigraf UCD-400
+	 * test equipment (TE). As part of this test, the TE issues a CP-IRQ
+	 * right after the successful completion of the HDCP authentication
+	 * part 2. This CP-IRQ handler gets invoked even before the HDCP
+	 * state engine gets transitioned to the polling mode, which can
+	 * cause the test to fail as we would not read the
+	 * RepeaterAuth_Send_ReceiverID_List from the TE in response to the
+	 * CP_IRQ.
+	 *
+	 * Skip this wait when any of the fields in the abort mask is set.
+	 */
+	if (ctrl->sink_rx_status & ctrl->abort_mask)
+		goto exit;
 
 
+	while (!ctrl->polling && retries--)
+		msleep(20);
+
+exit:
 	kfifo_put(&ctrl->cmd_q, HDCP_TRANSPORT_CMD_LINK_CHECK);
 	kfifo_put(&ctrl->cmd_q, HDCP_TRANSPORT_CMD_LINK_CHECK);
 	wake_up(&ctrl->wait_q);
 	wake_up(&ctrl->wait_q);
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT);
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT);