]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/display: avoid to authentication when DEVICE_COUNT=0
authorYu-ting Shen <Yu-ting.Shen@amd.com>
Wed, 14 Apr 2021 07:33:33 +0000 (15:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 29 Apr 2021 03:35:50 +0000 (23:35 -0400)
[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>
drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c
drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c

index 2cbd931363bdde756da39cc536ca3a26c2d7f5bb..43e6f8b17e79c75e4663d9832704c0483f9d56ef 100644 (file)
@@ -128,6 +128,11 @@ static inline uint8_t get_device_count(struct mod_hdcp *hdcp)
 
 static inline 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).
index c1331facdcb4934a316970fbc68eab8417402133..117c6b45f71891bcc5786dc0f4152e82ccc457bd 100644 (file)
@@ -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). */