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

Force encryption for HDCP 1.3 compliance or HDMI use cases only
since DisplayPort supports dynamic encryption enable.

Change-Id: Ice0f462188e4cc96597a4779a6daca7877e36b6c
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
This commit is contained in:
Tatenda Chipeperekwa
2019-04-25 16:54:25 -07:00
parent ce8550b2e4
commit bd8fff4f9f
2 changed files with 26 additions and 5 deletions

View File

@@ -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) {

View File

@@ -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,10 +1068,13 @@ 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.
*/ */
hdcp1_set_enc(hdcp->hdcp1_handle, true); if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI ||
hdcp->force_encryption)
hdcp1_set_enc(hdcp->hdcp1_handle, true);
rc = sde_hdcp_1x_authentication_part1(hdcp); rc = sde_hdcp_1x_authentication_part1(hdcp);
if (rc) if (rc)
@@ -1224,7 +1228,9 @@ 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);
hdcp1_set_enc(hdcp->hdcp1_handle, false); if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI ||
hdcp->force_encryption)
hdcp1_set_enc(hdcp->hdcp1_handle, false);
reg = DSS_REG_R(io, reg_set->reset); reg = DSS_REG_R(io, reg_set->reset);
DSS_REG_W(io, reg_set->reset, reg | reg_set->reset_bit); DSS_REG_W(io, reg_set->reset, reg | reg_set->reset_bit);
@@ -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);