]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/display: define mod_hdcp_display_disable_option struct
authorWenjing Liu <wenjing.liu@amd.com>
Wed, 10 Mar 2021 19:26:01 +0000 (14:26 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:48:11 +0000 (16:48 -0400)
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Reviewed-by: George Shen <George.Shen@amd.com>
Acked-by: Anson Jacob <Anson.Jacob@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c
drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h

index 0cdbfcd475ec90bf3c4d036ccdf512422fb2c116..60f91853bd82e715b8df4df85b8164255176857b 100644 (file)
@@ -191,7 +191,7 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
                                psp_set_srm(hdcp_work->hdcp.config.psp.handle, hdcp_work->srm, hdcp_work->srm_size,
                                            &hdcp_work->srm_version);
 
-                       display->adjust.disable = 0;
+                       display->adjust.disable = MOD_HDCP_DISPLAY_NOT_DISABLE;
                        if (content_type == DRM_MODE_HDCP_CONTENT_TYPE0) {
                                hdcp_w->link.adjust.hdcp1.disable = 0;
                                hdcp_w->link.adjust.hdcp2.force_type = MOD_HDCP_FORCE_TYPE_0;
@@ -203,7 +203,7 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
                        schedule_delayed_work(&hdcp_w->property_validate_dwork,
                                              msecs_to_jiffies(DRM_HDCP_CHECK_PERIOD_MS));
                } else {
-                       display->adjust.disable = 1;
+                       display->adjust.disable = MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION;
                        hdcp_w->encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
                        cancel_delayed_work(&hdcp_w->property_validate_dwork);
                }
@@ -456,7 +456,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
        link->dp.rev = aconnector->dc_link->dpcd_caps.dpcd_rev.raw;
        link->dp.assr_enabled = config->assr_enabled;
        link->dp.mst_enabled = config->mst_enabled;
-       display->adjust.disable = 1;
+       display->adjust.disable = MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION;
        link->adjust.auth_delay = 3;
        link->adjust.hdcp1.disable = 0;
 
index 20e554e771d1634ba2c2cb14124447adbfe70405..e7b841d960e708ab784c6ce638a5cd9bd39401eb 100644 (file)
@@ -53,7 +53,7 @@ static uint8_t is_cp_desired_hdcp1(struct mod_hdcp *hdcp)
         */
        for (i = 0; i < MAX_NUM_OF_DISPLAYS; i++) {
                if (hdcp->displays[i].state != MOD_HDCP_DISPLAY_INACTIVE &&
-                               !hdcp->displays[i].adjust.disable) {
+                               hdcp->displays[i].adjust.disable != MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION) {
                        is_auth_needed = 1;
                        break;
                }
@@ -74,7 +74,7 @@ static uint8_t is_cp_desired_hdcp2(struct mod_hdcp *hdcp)
         */
        for (i = 0; i < MAX_NUM_OF_DISPLAYS; i++) {
                if (hdcp->displays[i].state != MOD_HDCP_DISPLAY_INACTIVE &&
-                               !hdcp->displays[i].adjust.disable) {
+                               hdcp->displays[i].adjust.disable != MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION) {
                        is_auth_needed = 1;
                        break;
                }
index d223ed3be5d3deca64218cc5752c75472c80d9aa..5fbc4c1376e45d8d3f58efd9d107db0c5a4dd4aa 100644 (file)
@@ -120,6 +120,12 @@ enum mod_hdcp_display_state {
        MOD_HDCP_DISPLAY_ENCRYPTION_ENABLED
 };
 
+enum mod_hdcp_display_disable_option {
+       MOD_HDCP_DISPLAY_NOT_DISABLE = 0,
+       MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION,
+       MOD_HDCP_DISPLAY_DISABLE_ENCRYPTION,
+};
+
 struct mod_hdcp_ddc {
        void *handle;
        struct {
@@ -149,8 +155,8 @@ struct mod_hdcp_psp {
 };
 
 struct mod_hdcp_display_adjustment {
-       uint8_t disable                 : 1;
-       uint8_t reserved                : 7;
+       uint8_t disable                 : 2;
+       uint8_t reserved                : 6;
 };
 
 struct mod_hdcp_link_adjustment_hdcp1 {