diff options
author | Yu-ting Shen <Yu-ting.Shen@amd.com> | 2021-04-14 15:33:33 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-04-28 23:35:50 -0400 |
commit | 088bebc79ee8c5ee9d61fa0381af278d5ff7da45 (patch) | |
tree | 0e5aa0da6bde9ec6f190b65a71168b9d78213103 /drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c | |
parent | 642d3a2bf234578da83ed1fb6ef87dba36d31dea (diff) |
drm/amd/display: avoid to authentication when DEVICE_COUNT=0
[why]
we don't support authentication with DEVICE_COUNT=0
[how]
check value DEVICE_COUNT before doing authentication
Signed-off-by: Yu-ting Shen <Yu-ting.Shen@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Wayne Lin <waynelin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c index c1331facdcb4..117c6b45f718 100644 --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c @@ -207,6 +207,11 @@ static inline uint8_t get_device_count(struct mod_hdcp *hdcp) static enum mod_hdcp_status check_device_count(struct mod_hdcp *hdcp) { + /* Avoid device count == 0 to do authentication */ + if (0 == get_device_count(hdcp)) { + return MOD_HDCP_STATUS_HDCP1_DEVICE_COUNT_MISMATCH_FAILURE; + } + /* Some MST display may choose to report the internal panel as an HDCP RX. */ /* To update this condition with 1(because the immediate repeater's internal */ /* panel is possibly not included in DEVICE_COUNT) + get_device_count(hdcp). */ |