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

Commit d4a84072 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

msm: mdss: hdcp1x: handle hpd for hdcp use-cases



On receiving attention command from displayport with hpd high,
proceed with hdcp authentication. Also, once the authentication
is successful, enable the encryption.

Change-Id: I970545bbf99ba89804016844f5b294a7e762e6e5
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 7963ee24
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -2496,7 +2496,7 @@ static int mdss_dp_process_downstream_port_status_change(
 * (including cases when there are back to back HPD IRQ HIGH) indicating
 * the start of a new link training request or sink status update.
 */
static void mdss_dp_process_hpd_irq_high(struct mdss_dp_drv_pdata *dp)
static int mdss_dp_process_hpd_irq_high(struct mdss_dp_drv_pdata *dp)
{
	int ret = 0;

@@ -2516,10 +2516,11 @@ static void mdss_dp_process_hpd_irq_high(struct mdss_dp_drv_pdata *dp)
	if (!ret)
		goto exit;

	pr_debug("done\n");
exit:
	mdss_dp_reset_test_data(dp);

	pr_debug("done\n");
	return ret;
}

/**
@@ -2529,10 +2530,10 @@ exit:
 * This function will handle the HPD IRQ state transitions from HIGH to LOW,
 * indicating the end of a test request.
 */
static void mdss_dp_process_hpd_irq_low(struct mdss_dp_drv_pdata *dp)
static int mdss_dp_process_hpd_irq_low(struct mdss_dp_drv_pdata *dp)
{
	if (!dp->hpd_irq_clients_notified)
		return;
		return -EINVAL;

	pr_debug("enter: HPD IRQ low\n");

@@ -2546,6 +2547,7 @@ static void mdss_dp_process_hpd_irq_low(struct mdss_dp_drv_pdata *dp)
	mdss_dp_reset_test_data(dp);

	pr_debug("done\n");
	return 0;
}

static void usbpd_response_callback(struct usbpd_svid_handler *hdlr, u8 cmd,
@@ -2593,13 +2595,10 @@ static void usbpd_response_callback(struct usbpd_svid_handler *hdlr, u8 cmd,
			    dp_drv->hdcp.ops->cp_irq)
				dp_drv->hdcp.ops->cp_irq(dp_drv->hdcp.data);

			mdss_dp_process_hpd_irq_high(dp_drv);
			if (!mdss_dp_process_hpd_irq_high(dp_drv))
				break;
		}

		if (dp_drv->hpd_irq_toggled
				&& !dp_drv->alt_mode.dp_status.hpd_irq) {
			mdss_dp_process_hpd_irq_low(dp_drv);
		} else if (dp_drv->hpd_irq_toggled) {
			if (!mdss_dp_process_hpd_irq_low(dp_drv))
				break;
		}

+8 −0
Original line number Diff line number Diff line
@@ -1297,6 +1297,9 @@ static void hdcp_1x_int_work(struct work_struct *work)
		return;
	}

	if (hdcp_ctrl->hdcp_state == HDCP_STATE_AUTHENTICATED)
		hdcp1_set_enc(false);

	mutex_lock(hdcp_ctrl->init_data.mutex);
	hdcp_ctrl->hdcp_state = HDCP_STATE_AUTH_FAIL;
	mutex_unlock(hdcp_ctrl->init_data.mutex);
@@ -1385,6 +1388,8 @@ error:
				hdcp_ctrl->init_data.cb_data,
				hdcp_ctrl->hdcp_state);
		}

		hdcp1_set_enc(true);
	} else {
		DEV_DBG("%s: %s: HDCP state changed during authentication\n",
			__func__, HDCP_STATE_NAME);
@@ -1506,6 +1511,9 @@ void hdcp_1x_off(void *input)
		return;
	}

	if (hdcp_ctrl->hdcp_state == HDCP_STATE_AUTHENTICATED)
		hdcp1_set_enc(false);

	/*
	 * Disable HDCP interrupts.
	 * Also, need to set the state to inactive here so that any ongoing