drm/amd/display: no hdcp retry if bksv or ksv list is revoked
authorWenjing Liu <Wenjing.Liu@amd.com>
Thu, 17 Oct 2019 15:13:29 +0000 (11:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 12 Feb 2020 21:01:38 +0000 (16:01 -0500)
[why]
According to the specs when bksv or ksv list fails SRM check,
HDCP TX should abort hdcp immediately.
However with the current code HDCP will be reattampt upto 4 times.

[how]
Add the logic that stop HDCP retry if bksv or ksv list
is revoked.

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h
drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_transition.c
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_log.c
drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h

index 8aa528e..a7d2473 100644 (file)
@@ -61,7 +61,8 @@ static uint8_t is_cp_desired_hdcp1(struct mod_hdcp *hdcp)
 
        return (hdcp->connection.hdcp1_retry_count < MAX_NUM_OF_ATTEMPTS) &&
                        is_auth_needed &&
-                       !hdcp->connection.link.adjust.hdcp1.disable;
+                       !hdcp->connection.link.adjust.hdcp1.disable &&
+                       !hdcp->connection.is_hdcp1_revoked;
 }
 
 static uint8_t is_cp_desired_hdcp2(struct mod_hdcp *hdcp)
index af78e4f..4d717ec 100644 (file)
@@ -170,6 +170,7 @@ struct mod_hdcp_connection {
        struct mod_hdcp_display displays[MAX_NUM_OF_DISPLAYS];
        uint8_t is_repeater;
        uint8_t is_km_stored;
+       uint8_t is_hdcp1_revoked;
        uint8_t is_hdcp2_revoked;
        struct mod_hdcp_trace trace;
        uint8_t hdcp1_retry_count;
index 76edcbe..d66a9f9 100644 (file)
@@ -210,7 +210,8 @@ enum mod_hdcp_status mod_hdcp_hdcp1_dp_transition(struct mod_hdcp *hdcp,
                        fail_and_restart_in_ms(0, &status, output);
                        break;
                } else if (input->rx_validation != PASS) {
-                       if (hdcp->state.stay_count < 2) {
+                       if (hdcp->state.stay_count < 2 &&
+                                       !hdcp->connection.is_hdcp1_revoked) {
                                /* allow 2 additional retries */
                                callback_in_ms(0, output);
                                increment_stay_counter(hdcp);
@@ -290,7 +291,8 @@ enum mod_hdcp_status mod_hdcp_hdcp1_dp_transition(struct mod_hdcp *hdcp,
                        fail_and_restart_in_ms(0, &status, output);
                        break;
                } else if (input->ksvlist_vp_validation != PASS) {
-                       if (hdcp->state.stay_count < 2) {
+                       if (hdcp->state.stay_count < 2 &&
+                                       !hdcp->connection.is_hdcp1_revoked) {
                                /* allow 2 additional retries */
                                callback_in_ms(0, output);
                                increment_stay_counter(hdcp);
index 724ebce..44956f9 100644 (file)
@@ -90,10 +90,14 @@ char *mod_hdcp_status_to_str(int32_t status)
                return "MOD_HDCP_STATUS_HDCP1_R0_PRIME_PENDING";
        case MOD_HDCP_STATUS_HDCP1_VALIDATE_RX_FAILURE:
                return "MOD_HDCP_STATUS_HDCP1_VALIDATE_RX_FAILURE";
+       case MOD_HDCP_STATUS_HDCP1_BKSV_REVOKED:
+               return "MOD_HDCP_STATUS_HDCP1_BKSV_REVOKED";
        case MOD_HDCP_STATUS_HDCP1_KSV_LIST_NOT_READY:
                return "MOD_HDCP_STATUS_HDCP1_KSV_LIST_NOT_READY";
        case MOD_HDCP_STATUS_HDCP1_VALIDATE_KSV_LIST_FAILURE:
                return "MOD_HDCP_STATUS_HDCP1_VALIDATE_KSV_LIST_FAILURE";
+       case MOD_HDCP_STATUS_HDCP1_KSV_LIST_REVOKED:
+               return "MOD_HDCP_STATUS_HDCP1_KSV_LIST_REVOKED";
        case MOD_HDCP_STATUS_HDCP1_ENABLE_ENCRYPTION:
                return "MOD_HDCP_STATUS_HDCP1_ENABLE_ENCRYPTION";
        case MOD_HDCP_STATUS_HDCP1_ENABLE_STREAM_ENCRYPTION_FAILURE:
index f2a0e1a..891bca5 100644 (file)
@@ -56,8 +56,10 @@ enum mod_hdcp_status {
        MOD_HDCP_STATUS_HDCP1_NOT_CAPABLE,
        MOD_HDCP_STATUS_HDCP1_R0_PRIME_PENDING,
        MOD_HDCP_STATUS_HDCP1_VALIDATE_RX_FAILURE,
+       MOD_HDCP_STATUS_HDCP1_BKSV_REVOKED,
        MOD_HDCP_STATUS_HDCP1_KSV_LIST_NOT_READY,
        MOD_HDCP_STATUS_HDCP1_VALIDATE_KSV_LIST_FAILURE,
+       MOD_HDCP_STATUS_HDCP1_KSV_LIST_REVOKED,
        MOD_HDCP_STATUS_HDCP1_ENABLE_ENCRYPTION,
        MOD_HDCP_STATUS_HDCP1_ENABLE_STREAM_ENCRYPTION_FAILURE,
        MOD_HDCP_STATUS_HDCP1_MAX_CASCADE_EXCEEDED_FAILURE,