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

Commit 8f703d9a authored by Narender Ankam's avatar Narender Ankam
Browse files

msm: mdss: hdmi: add SRM support for HDCP2.2



Extend HDCP2.2 SRM support for fb based hdmi driver as well.

Change-Id: I39bef2a814c2a2404a0a03584f23c58c69c10909
Signed-off-by: default avatarNarender Ankam <nankam@codeaurora.org>
parent eee0928c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2014-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2014-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -28,6 +28,7 @@ enum hdcp_states {
	HDCP_STATE_AUTHENTICATING,
	HDCP_STATE_AUTHENTICATED,
	HDCP_STATE_AUTH_FAIL,
	HDCP_STATE_AUTH_FAIL_NOREAUTH,
	HDCP_STATE_AUTH_ENC_NONE,
	HDCP_STATE_AUTH_ENC_1X,
	HDCP_STATE_AUTH_ENC_2P2
+37 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -463,6 +463,41 @@ static void hdmi_hdcp2p2_auth_failed(struct hdmi_hdcp2p2_ctrl *ctrl)
		HDCP_STATE_AUTH_FAIL);
}

static void hdmi_hdcp2p2_fail_noreauth(struct hdmi_hdcp2p2_ctrl *ctrl)
{
	if (!ctrl) {
		pr_err("invalid input\n");
		return;
	}

	atomic_set(&ctrl->auth_state, HDCP_STATE_AUTH_FAIL);

	hdmi_hdcp2p2_ddc_disable(ctrl->init_data.cb_data);

	/* notify hdmi tx about HDCP failure */
	ctrl->init_data.notify_status(ctrl->init_data.cb_data,
		HDCP_STATE_AUTH_FAIL_NOREAUTH);
}

static void hdmi_hdcp2p2_srm_cb(void *client_ctx)
{
	struct hdmi_hdcp2p2_ctrl *ctrl =
		(struct hdmi_hdcp2p2_ctrl *)client_ctx;
	struct hdcp_lib_wakeup_data cdata = {
		HDCP_LIB_WKUP_CMD_INVALID};

	if (!ctrl) {
		pr_err("invalid input\n");
		return;
	}

	cdata.context = ctrl->lib_ctx;
	cdata.cmd = HDCP_LIB_WKUP_CMD_STOP;
	hdmi_hdcp2p2_wakeup_lib(ctrl, &cdata);

	hdmi_hdcp2p2_fail_noreauth(ctrl);
}

static int hdmi_hdcp2p2_ddc_read_message(struct hdmi_hdcp2p2_ctrl *ctrl,
	u8 *buf, int size, u32 timeout)
{
@@ -995,6 +1030,7 @@ void *hdmi_hdcp2p2_init(struct hdcp_init_data *init_data)

	static struct hdcp_client_ops client_ops = {
		.wakeup = hdmi_hdcp2p2_wakeup,
		.srm_cb = hdmi_hdcp2p2_srm_cb,
	};

	static struct hdcp_txmtr_ops txmtr_ops;
+9 −0
Original line number Diff line number Diff line
@@ -1609,6 +1609,15 @@ static void hdmi_tx_hdcp_cb_work(struct work_struct *work)
				__func__);
		}

		break;
	case HDCP_STATE_AUTH_FAIL_NOREAUTH:
		if (hdmi_ctrl->hdcp1_use_sw_keys && hdmi_ctrl->hdcp14_present) {
			if (hdmi_ctrl->auth_state && !hdmi_ctrl->hdcp22_present)
				hdcp1_set_enc(false);
		}

		hdmi_ctrl->auth_state = false;

		break;
	case HDCP_STATE_AUTH_ENC_NONE:
		hdmi_ctrl->enc_lvl = HDCP_STATE_AUTH_ENC_NONE;