Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Add HDCP policy control

[Why]
DM should be able to control HDCP retry limit via configurable
parameter.

[How]
Expose a retry_limit parameter for controlling the maximum number of
retries and lift the hardcode out to DM.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Oleh Kuzhylnyi <okuzhyln@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Oleh Kuzhylnyi and committed by
Alex Deucher
9fd2da71 d6fa8026

+6 -2
+2
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
··· 223 223 display_adjust.disable = MOD_HDCP_DISPLAY_NOT_DISABLE; 224 224 225 225 link_adjust.auth_delay = 2; 226 + link_adjust.retry_limit = MAX_NUM_OF_ATTEMPTS; 226 227 227 228 if (content_type == DRM_MODE_HDCP_CONTENT_TYPE0) { 228 229 link_adjust.hdcp2.force_type = MOD_HDCP_FORCE_TYPE_0; ··· 573 572 link->dp.usb4_enabled = config->usb4_enabled; 574 573 display->adjust.disable = MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION; 575 574 link->adjust.auth_delay = 2; 575 + link->adjust.retry_limit = MAX_NUM_OF_ATTEMPTS; 576 576 link->adjust.hdcp1.disable = 0; 577 577 hdcp_w->encryption_status[display->index] = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF; 578 578
+3 -2
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c
··· 29 29 enum mod_hdcp_status status) 30 30 { 31 31 struct mod_hdcp_trace *trace = &hdcp->connection.trace; 32 + const uint8_t retry_limit = hdcp->connection.link.adjust.retry_limit; 32 33 33 34 if (trace->error_count < MAX_NUM_OF_ERROR_TRACE) { 34 35 trace->errors[trace->error_count].status = status; ··· 40 39 41 40 if (is_hdcp1(hdcp)) { 42 41 hdcp->connection.hdcp1_retry_count++; 43 - if (hdcp->connection.hdcp1_retry_count == MAX_NUM_OF_ATTEMPTS) 42 + if (hdcp->connection.hdcp1_retry_count == retry_limit) 44 43 hdcp->connection.link.adjust.hdcp1.disable = 1; 45 44 } else if (is_hdcp2(hdcp)) { 46 45 hdcp->connection.hdcp2_retry_count++; 47 - if (hdcp->connection.hdcp2_retry_count == MAX_NUM_OF_ATTEMPTS) 46 + if (hdcp->connection.hdcp2_retry_count == retry_limit) 48 47 hdcp->connection.link.adjust.hdcp2.disable = 1; 49 48 } 50 49 }
+1
drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h
··· 220 220 221 221 struct mod_hdcp_link_adjustment { 222 222 uint8_t auth_delay; 223 + uint8_t retry_limit; 223 224 struct mod_hdcp_link_adjustment_hdcp1 hdcp1; 224 225 struct mod_hdcp_link_adjustment_hdcp2 hdcp2; 225 226 };