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

Commit ea098821 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: hdcp: force encryption for HDCP 1.3 compliance"

parents e90235e1 bd8fff4f
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -348,7 +348,8 @@ static void dp_display_hdcp_cb_work(struct work_struct *work)


	dp_display_update_hdcp_status(dp, false);
	dp_display_update_hdcp_status(dp, false);


	if (dp->debug->force_encryption && ops && ops->force_encryption)
	if (status->hdcp_state != HDCP_STATE_AUTHENTICATED &&
		dp->debug->force_encryption && ops && ops->force_encryption)
		ops->force_encryption(data, dp->debug->force_encryption);
		ops->force_encryption(data, dp->debug->force_encryption);


	switch (status->hdcp_state) {
	switch (status->hdcp_state) {
+24 −4
Original line number Original line Diff line number Diff line
@@ -206,6 +206,7 @@ struct sde_hdcp_1x {
	bool sink_r0_ready;
	bool sink_r0_ready;
	bool reauth;
	bool reauth;
	bool ksv_ready;
	bool ksv_ready;
	bool force_encryption;
	enum sde_hdcp_state hdcp_state;
	enum sde_hdcp_state hdcp_state;
	struct HDCP_V2V1_MSG_TOPOLOGY current_tp;
	struct HDCP_V2V1_MSG_TOPOLOGY current_tp;
	struct delayed_work hdcp_auth_work;
	struct delayed_work hdcp_auth_work;
@@ -1067,9 +1068,12 @@ static void sde_hdcp_1x_auth_work(struct work_struct *work)
	}
	}


	/*
	/*
	 * program hw to enable encryption as soon as
	 * Program h/w to enable encryption as soon as authentication is
	 * authentication is successful.
	 * successful. This is applicable for HDMI sinks and HDCP 1.x compliance
	 * test cases.
	 */
	 */
	if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI ||
			hdcp->force_encryption)
		hdcp1_set_enc(hdcp->hdcp1_handle, true);
		hdcp1_set_enc(hdcp->hdcp1_handle, true);


	rc = sde_hdcp_1x_authentication_part1(hdcp);
	rc = sde_hdcp_1x_authentication_part1(hdcp);
@@ -1224,6 +1228,8 @@ static void sde_hdcp_1x_off(void *input)
		pr_debug("%s: Deleted hdcp auth work\n",
		pr_debug("%s: Deleted hdcp auth work\n",
			SDE_HDCP_STATE_NAME);
			SDE_HDCP_STATE_NAME);


	if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI ||
			hdcp->force_encryption)
		hdcp1_set_enc(hdcp->hdcp1_handle, false);
		hdcp1_set_enc(hdcp->hdcp1_handle, false);


	reg = DSS_REG_R(io, reg_set->reset);
	reg = DSS_REG_R(io, reg_set->reset);
@@ -1353,6 +1359,18 @@ static bool sde_hdcp_1x_feature_supported(void *input)
	return feature_supported;
	return feature_supported;
}
}


static void sde_hdcp_1x_force_encryption(void *input, bool enable)
{
	struct sde_hdcp_1x *hdcp = (struct sde_hdcp_1x *)input;

	if (!hdcp) {
		pr_err("invalid input\n");
		return;
	}
	hdcp->force_encryption = enable;
	pr_info("force_encryption=%d\n", hdcp->force_encryption);
}

static bool sde_hdcp_1x_sink_support(void *input)
static bool sde_hdcp_1x_sink_support(void *input)
{
{
	return true;
	return true;
@@ -1476,6 +1494,7 @@ void *sde_hdcp_1x_init(struct sde_hdcp_init_data *init_data)
		.reauthenticate = sde_hdcp_1x_reauthenticate,
		.reauthenticate = sde_hdcp_1x_reauthenticate,
		.authenticate = sde_hdcp_1x_authenticate,
		.authenticate = sde_hdcp_1x_authenticate,
		.feature_supported = sde_hdcp_1x_feature_supported,
		.feature_supported = sde_hdcp_1x_feature_supported,
		.force_encryption = sde_hdcp_1x_force_encryption,
		.sink_support = sde_hdcp_1x_sink_support,
		.sink_support = sde_hdcp_1x_sink_support,
		.off = sde_hdcp_1x_off
		.off = sde_hdcp_1x_off
	};
	};
@@ -1520,6 +1539,7 @@ void *sde_hdcp_1x_init(struct sde_hdcp_init_data *init_data)
	hdcp->hdcp_state = HDCP_STATE_INACTIVE;
	hdcp->hdcp_state = HDCP_STATE_INACTIVE;
	init_completion(&hdcp->r0_checked);
	init_completion(&hdcp->r0_checked);
	init_completion(&hdcp->sink_r0_available);
	init_completion(&hdcp->sink_r0_available);
	hdcp->force_encryption = false;


	pr_debug("HDCP module initialized. HDCP_STATE=%s\n",
	pr_debug("HDCP module initialized. HDCP_STATE=%s\n",
		SDE_HDCP_STATE_NAME);
		SDE_HDCP_STATE_NAME);