drm/dp_mst: Parse FEC capability on MST ports
authorDavid Francis <David.Francis@amd.com>
Thu, 6 Jun 2019 15:20:10 +0000 (11:20 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Jan 2020 23:07:46 +0000 (18:07 -0500)
As of DP1.4, ENUM_PATH_RESOURCES returns a bit indicating
if FEC can be supported up to that point in the MST network.

The bit is the first byte of the ENUM_PATH_RESOURCES ack reply,
bottom-most bit (refer to section 2.11.9.4 of DP standard,
v1.4)

That value is needed for FEC and DSC support

Store it on drm_dp_mst_port

Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: David Francis <David.Francis@amd.com>
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_dp_mst_topology.c
include/drm/drm_dp_mst_helper.h

index 2443532..77d95e2 100644 (file)
@@ -853,6 +853,7 @@ static bool drm_dp_sideband_parse_enum_path_resources_ack(struct drm_dp_sideband
 {
        int idx = 1;
        repmsg->u.path_resources.port_number = (raw->msg[idx] >> 4) & 0xf;
+       repmsg->u.path_resources.fec_capable = raw->msg[idx] & 0x1;
        idx++;
        if (idx > raw->curlen)
                goto fail_len;
@@ -2951,6 +2952,7 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr,
                                      path_res->avail_payload_bw_number);
                        port->available_pbn =
                                path_res->avail_payload_bw_number;
+                       port->fec_capable = path_res->fec_capable;
                }
        }
 
index 0c59c9a..f4b8bc0 100644 (file)
@@ -156,6 +156,8 @@ struct drm_dp_mst_port {
         * audio-capable.
         */
        bool has_audio;
+
+       bool fec_capable;
 };
 
 /**
@@ -383,6 +385,7 @@ struct drm_dp_port_number_req {
 
 struct drm_dp_enum_path_resources_ack_reply {
        u8 port_number;
+       bool fec_capable;
        u16 full_payload_bw_number;
        u16 avail_payload_bw_number;
 };