drm/amd/display: Retrieve DSC Branch Decoder Caps
authorFangzhi Zuo <Jerry.Zuo@amd.com>
Mon, 10 May 2021 16:01:42 +0000 (12:01 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 May 2021 16:24:45 +0000 (12:24 -0400)
DSC extended branch decoder caps 0xA0 ~ 0xA2 is read from dsc_aux.
The dsc_aux is returned from drm dsc determination policy with the
right DSC capable MST branch device for decoding.

The values are all zero if DSC decoding at a MST BU with virtual DPCD;
The values are meaningful when DSC decoding at a MST BU without
virtual DPCD or at a DSC capable MST endpoint.

Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

index e6b2eec..6f0a1fd 100644 (file)
@@ -160,6 +160,8 @@ static bool validate_dsc_caps_on_connector(struct amdgpu_dm_connector *aconnecto
        struct dc_sink *dc_sink = aconnector->dc_sink;
        struct drm_dp_mst_port *port = aconnector->port;
        u8 dsc_caps[16] = { 0 };
+       u8 dsc_branch_dec_caps_raw[3] = { 0 };  // DSC branch decoder caps 0xA0 ~ 0xA2
+       u8 *dsc_branch_dec_caps = NULL;
 
        aconnector->dsc_aux = drm_dp_mst_dsc_aux_for_port(port);
 #if defined(CONFIG_HP_HOOK_WORKAROUND)
@@ -182,9 +184,13 @@ static bool validate_dsc_caps_on_connector(struct amdgpu_dm_connector *aconnecto
        if (drm_dp_dpcd_read(aconnector->dsc_aux, DP_DSC_SUPPORT, dsc_caps, 16) < 0)
                return false;
 
+       if (drm_dp_dpcd_read(aconnector->dsc_aux,
+                       DP_DSC_BRANCH_OVERALL_THROUGHPUT_0, dsc_branch_dec_caps_raw, 3) == 3)
+               dsc_branch_dec_caps = dsc_branch_dec_caps_raw;
+
        if (!dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
-                                  dsc_caps, NULL,
-                                  &dc_sink->dsc_caps.dsc_dec_caps))
+                                 dsc_caps, dsc_branch_dec_caps,
+                                 &dc_sink->dsc_caps.dsc_dec_caps))
                return false;
 
        return true;