drm/amd/display: Revise Sink device string ID
authorRobin Chen <po-tchen@amd.com>
Thu, 8 Sep 2022 13:42:10 +0000 (21:42 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Sep 2022 19:16:26 +0000 (15:16 -0400)
[Why]
The Sink device string ID1/ID2 use 5 bytes instead of 6 bytes,
so the driver should compare the first 5 bytes only.

Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Robin Chen <po-tchen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
drivers/gpu/drm/amd/display/include/ddc_service_types.h

index 0df0674..bec5e9f 100644 (file)
@@ -393,17 +393,18 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub,
        if (copy_settings_data->dsc_enable_status &&
                link->dpcd_caps.sink_dev_id == DP_DEVICE_ID_38EC11 &&
                !memcmp(link->dpcd_caps.sink_dev_id_str, DP_SINK_DEVICE_STR_ID_1,
-                       sizeof(link->dpcd_caps.sink_dev_id_str)))
+                       sizeof(DP_SINK_DEVICE_STR_ID_1)))
                link->psr_settings.force_ffu_mode = 1;
        else
                link->psr_settings.force_ffu_mode = 0;
        copy_settings_data->force_ffu_mode = link->psr_settings.force_ffu_mode;
 
        if (link->fec_state == dc_link_fec_enabled &&
+               link->dpcd_caps.sink_dev_id == DP_DEVICE_ID_38EC11 &&
                (!memcmp(link->dpcd_caps.sink_dev_id_str, DP_SINK_DEVICE_STR_ID_1,
-                       sizeof(link->dpcd_caps.sink_dev_id_str)) ||
+                       sizeof(DP_SINK_DEVICE_STR_ID_1)) ||
                !memcmp(link->dpcd_caps.sink_dev_id_str, DP_SINK_DEVICE_STR_ID_2,
-                       sizeof(link->dpcd_caps.sink_dev_id_str))))
+                       sizeof(DP_SINK_DEVICE_STR_ID_2))))
                copy_settings_data->debug.bitfields.force_wakeup_by_tps3 = 1;
        else
                copy_settings_data->debug.bitfields.force_wakeup_by_tps3 = 0;
index 05096c6..a7ba5bd 100644 (file)
@@ -128,8 +128,8 @@ struct av_sync_data {
        uint8_t aud_del_ins3;/* DPCD 0002Dh */
 };
 
-static const uint8_t DP_SINK_DEVICE_STR_ID_1[] = {7, 1, 8, 7, 3, 0};
-static const uint8_t DP_SINK_DEVICE_STR_ID_2[] = {7, 1, 8, 7, 5, 0};
+static const uint8_t DP_SINK_DEVICE_STR_ID_1[] = {7, 1, 8, 7, 3};
+static const uint8_t DP_SINK_DEVICE_STR_ID_2[] = {7, 1, 8, 7, 5};
 
 static const u8 DP_SINK_BRANCH_DEV_NAME_7580[] = "7580\x80u";