Skip to content

Commit a585553

Browse files
Fangzhi Zuoalexdeucher
authored andcommitted
drm/amd/display: Fix DSC not Enabled on Direct MST Sink
[WHY & HOW] For the scenario when a dsc capable MST sink device is directly connected, it needs to use max dsc compression as the link bw constraint. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Roman Li <roman.li@amd.com> Acked-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 8a0173c commit a585553

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,31 +1604,31 @@ enum dc_status dm_dp_mst_is_port_support_mode(
16041604
unsigned int upper_link_bw_in_kbps = 0, down_link_bw_in_kbps = 0;
16051605
unsigned int max_compressed_bw_in_kbps = 0;
16061606
struct dc_dsc_bw_range bw_range = {0};
1607-
struct drm_dp_mst_topology_mgr *mst_mgr;
1607+
uint16_t full_pbn = aconnector->mst_output_port->full_pbn;
16081608

16091609
/*
1610-
* check if the mode could be supported if DSC pass-through is supported
1611-
* AND check if there enough bandwidth available to support the mode
1612-
* with DSC enabled.
1610+
* Consider the case with the depth of the mst topology tree is equal or less than 2
1611+
* A. When dsc bitstream can be transmitted along the entire path
1612+
* 1. dsc is possible between source and branch/leaf device (common dsc params is possible), AND
1613+
* 2. dsc passthrough supported at MST branch, or
1614+
* 3. dsc decoding supported at leaf MST device
1615+
* Use maximum dsc compression as bw constraint
1616+
* B. When dsc bitstream cannot be transmitted along the entire path
1617+
* Use native bw as bw constraint
16131618
*/
16141619
if (is_dsc_common_config_possible(stream, &bw_range) &&
1615-
aconnector->mst_output_port->passthrough_aux) {
1616-
mst_mgr = aconnector->mst_output_port->mgr;
1617-
mutex_lock(&mst_mgr->lock);
1618-
1620+
(aconnector->mst_output_port->passthrough_aux ||
1621+
aconnector->dsc_aux == &aconnector->mst_output_port->aux)) {
16191622
cur_link_settings = stream->link->verified_link_cap;
16201623

16211624
upper_link_bw_in_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
1622-
&cur_link_settings
1623-
);
1624-
down_link_bw_in_kbps = kbps_from_pbn(aconnector->mst_output_port->full_pbn);
1625+
&cur_link_settings);
1626+
down_link_bw_in_kbps = kbps_from_pbn(full_pbn);
16251627

16261628
/* pick the bottleneck */
16271629
end_to_end_bw_in_kbps = min(upper_link_bw_in_kbps,
16281630
down_link_bw_in_kbps);
16291631

1630-
mutex_unlock(&mst_mgr->lock);
1631-
16321632
/*
16331633
* use the maximum dsc compression bandwidth as the required
16341634
* bandwidth for the mode
@@ -1643,8 +1643,7 @@ enum dc_status dm_dp_mst_is_port_support_mode(
16431643
/* check if mode could be supported within full_pbn */
16441644
bpp = convert_dc_color_depth_into_bpc(stream->timing.display_color_depth) * 3;
16451645
pbn = drm_dp_calc_pbn_mode(stream->timing.pix_clk_100hz / 10, bpp, false);
1646-
1647-
if (pbn > aconnector->mst_output_port->full_pbn)
1646+
if (pbn > full_pbn)
16481647
return DC_FAIL_BANDWIDTH_VALIDATE;
16491648
}
16501649

0 commit comments

Comments
 (0)