drm/amd/display: block passive dongle EDID Emulation for USB-C ports
authorSamson Tam <Samson.Tam@amd.com>
Fri, 12 Apr 2019 22:23:11 +0000 (18:23 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:20:49 +0000 (12:20 -0500)
[Why]
Emulating passive dongle on USB-C port causes issue on some asics.

[How]
Check for DP_IS_USB_C flag in bios parser and propagate it to
encoder features flags. If DP_IS_USB_C flag is set and it is trying to
emulate passive dongle, then return fail.

Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
drivers/gpu/drm/amd/display/include/bios_parser_types.h

index fd5266a..12bc7ee 100644 (file)
@@ -1313,6 +1313,8 @@ static enum bp_result bios_parser_get_encoder_cap_info(
                        ATOM_ENCODER_CAP_RECORD_HBR3_EN) ? 1 : 0;
        info->HDMI_6GB_EN = (record->encodercaps &
                        ATOM_ENCODER_CAP_RECORD_HDMI6Gbps_EN) ? 1 : 0;
+       info->DP_IS_USB_C = (record->encodercaps &
+                       ATOM_ENCODER_CAP_RECORD_USB_C_TYPE) ? 1 : 0;
 
        return BP_RESULT_OK;
 }
index 0126a44..e25ae43 100644 (file)
@@ -726,6 +726,8 @@ void dcn10_link_encoder_construct(
                enc10->base.features.flags.bits.IS_HBR3_CAPABLE =
                                bp_cap_info.DP_HBR3_EN;
                enc10->base.features.flags.bits.HDMI_6GB_EN = bp_cap_info.HDMI_6GB_EN;
+               enc10->base.features.flags.bits.DP_IS_USB_C =
+                               bp_cap_info.DP_IS_USB_C;
        } else {
                DC_LOG_WARNING("%s: Failed to get encoder_cap_info from VBIOS with error code %d!\n",
                                __func__,
index c9d3e37..ca16207 100644 (file)
@@ -59,6 +59,7 @@ struct encoder_feature_support {
                        uint32_t IS_TPS3_CAPABLE:1;
                        uint32_t IS_TPS4_CAPABLE:1;
                        uint32_t HDMI_6GB_EN:1;
+                       uint32_t DP_IS_USB_C:1;
                } bits;
                uint32_t raw;
        } flags;
index 01bf01a..c30437a 100644 (file)
@@ -307,7 +307,8 @@ struct bp_encoder_cap_info {
        uint32_t DP_HBR2_EN:1;
        uint32_t DP_HBR3_EN:1;
        uint32_t HDMI_6GB_EN:1;
-       uint32_t RESERVED:30;
+       uint32_t DP_IS_USB_C:1;
+       uint32_t RESERVED:27;
 };
 
 #endif /*__DAL_BIOS_PARSER_TYPES_H__ */