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

Commit 8ac9f6ee authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

msm: mdss: hdcp_1x: add cp_irq support



Content Protection IRQ is a mechanism used by HDCP 1.3
protocol over DisplayPort to notify source device about
current hdcp status of receiver/repeater device. Handle
cp_irq to listen to sink receiver/repeater events and
update source hdcp state accordingly.

Change-Id: I63ecf6045f13e8b1d75bf6db2135671aa30c9e60
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 1e170076
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2599,8 +2599,10 @@ static void mdss_dp_process_attention(struct mdss_dp_drv_pdata *dp_drv)
		pr_debug("Attention: hpd_irq high\n");

		if (dp_drv->power_on && dp_drv->hdcp.ops &&
		    dp_drv->hdcp.ops->cp_irq)
			dp_drv->hdcp.ops->cp_irq(dp_drv->hdcp.data);
		    dp_drv->hdcp.ops->cp_irq) {
			if (!dp_drv->hdcp.ops->cp_irq(dp_drv->hdcp.data))
				return;
		}

		if (!mdss_dp_process_hpd_irq_high(dp_drv))
			return;
+17 −12
Original line number Diff line number Diff line
@@ -574,18 +574,6 @@ static void dp_hdcp2p2_link_work(struct kthread_work *work)

	cdata.context = ctrl->lib_ctx;

	ctrl->sink_rx_status = 0;
	rc = mdss_dp_aux_read_rx_status(ctrl->init_data.cb_data,
		&ctrl->sink_rx_status);

	if (rc) {
		pr_err("failed to read rx status\n");

		cdata.cmd = HDCP_LIB_WKUP_CMD_LINK_FAILED;
		atomic_set(&ctrl->auth_state, HDCP_STATE_AUTH_FAIL);
		goto exit;
	}

	if (ctrl->sink_rx_status & ctrl->abort_mask) {
		if (ctrl->sink_rx_status & BIT(3))
			pr_err("reauth_req set by sink\n");
@@ -636,6 +624,7 @@ static void dp_hdcp2p2_auth_work(struct kthread_work *work)

static int dp_hdcp2p2_cp_irq(void *input)
{
	int rc = 0;
	struct dp_hdcp2p2_ctrl *ctrl = input;

	if (!ctrl) {
@@ -643,9 +632,25 @@ static int dp_hdcp2p2_cp_irq(void *input)
		return -EINVAL;
	}

	ctrl->sink_rx_status = 0;
	rc = mdss_dp_aux_read_rx_status(ctrl->init_data.cb_data,
		&ctrl->sink_rx_status);
	if (rc) {
		pr_err("failed to read rx status\n");
		goto error;
	}

	if (!ctrl->sink_rx_status) {
		pr_debug("not a hdcp 2.2 irq\n");
		rc = -EINVAL;
		goto error;
	}

	queue_kthread_work(&ctrl->worker, &ctrl->link);

	return 0;
error:
	return rc;
}

void dp_hdcp2p2_deinit(void *input)
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@
#define DP_HDCP_RCVPORT_DATA6                          (0x0C4)

#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_SHA_CTRL           (0x024)
#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_SHA_DATA           (0x028)
#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA0      (0x004)
#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA1      (0x008)
#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA7      (0x00C)
+229 −116

File changed.

Preview size limit exceeded, changes collapsed.