drm/amd/display: Refactor dp vendor parsing logic to a function
authorJohn Barberiz <John.Barberiz@amd.com>
Wed, 3 Apr 2019 23:22:55 +0000 (19:22 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 29 Apr 2019 19:59:13 +0000 (14:59 -0500)
Refactor dp vendor parsing int to a new function, and call it before
get_active_converter_info().

Also, add a flag to skip parsing of Display ID 2.0. Some devices fail on
readind DID2, but we shouldn't fail EDID read because of it. Add this
flag to facilitate the logic.

Signed-off-by: John Barberiz <John.Barberiz@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/dc_link.h

index 64a309a5e1c997ad2acc9fa38846b54a0ee741a8..1ee544a32ebb3c33875c9d161d08a0f5675279e4 100644 (file)
@@ -2185,6 +2185,30 @@ static int translate_dpcd_max_bpc(enum dpcd_downstream_port_max_bpc bpc)
        return -1;
 }
 
+static void read_dp_device_vendor_id(struct dc_link *link)
+{
+       struct dp_device_vendor_id dp_id;
+
+       /* read IEEE branch device id */
+       core_link_read_dpcd(
+               link,
+               DP_BRANCH_OUI,
+               (uint8_t *)&dp_id,
+               sizeof(dp_id));
+
+       link->dpcd_caps.branch_dev_id =
+               (dp_id.ieee_oui[0] << 16) +
+               (dp_id.ieee_oui[1] << 8) +
+               dp_id.ieee_oui[2];
+
+       memmove(
+               link->dpcd_caps.branch_dev_name,
+               dp_id.ieee_device_id,
+               sizeof(dp_id.ieee_device_id));
+}
+
+
+
 static void get_active_converter_info(
        uint8_t data, struct dc_link *link)
 {
@@ -2270,27 +2294,6 @@ static void get_active_converter_info(
 
        ddc_service_set_dongle_type(link->ddc, link->dpcd_caps.dongle_type);
 
-       {
-               struct dp_device_vendor_id dp_id;
-
-               /* read IEEE branch device id */
-               core_link_read_dpcd(
-                       link,
-                       DP_BRANCH_OUI,
-                       (uint8_t *)&dp_id,
-                       sizeof(dp_id));
-
-               link->dpcd_caps.branch_dev_id =
-                       (dp_id.ieee_oui[0] << 16) +
-                       (dp_id.ieee_oui[1] << 8) +
-                       dp_id.ieee_oui[2];
-
-               memmove(
-                       link->dpcd_caps.branch_dev_name,
-                       dp_id.ieee_device_id,
-                       sizeof(dp_id.ieee_device_id));
-       }
-
        {
                struct dp_sink_hw_fw_revision dp_hw_fw_revision;
 
@@ -2455,6 +2458,8 @@ static bool retrieve_link_cap(struct dc_link *link)
        ds_port.byte = dpcd_data[DP_DOWNSTREAMPORT_PRESENT -
                                 DP_DPCD_REV];
 
+       read_dp_device_vendor_id(link);
+
        get_active_converter_info(ds_port.byte, link);
 
        dp_wa_power_up_0010FA(link, dpcd_data, sizeof(dpcd_data));
index cc7ffac64c9611b00c254300e47c923501bdaacc..7b9429e30d821cabdb103dc5eb7a0b0b0b5c34ce 100644 (file)
@@ -120,6 +120,7 @@ struct dc_link {
        /* MST record stream using this link */
        struct link_flags {
                bool dp_keep_receiver_powered;
+               bool dp_skip_DID2;
        } wa_flags;
        struct link_mst_stream_allocation_table mst_stream_alloc_table;