From: Fangzhi Zuo <[email protected]> Commit "drm/amd/display: Force DSC to 8bpp for SST DP tunneling over USB4" forces DSC and caps the target to 8 bpp for SST streams on a USB4 DPIA link with bandwidth allocation enabled. The MST DSC fairness path does not honor that policy: it derives the bpp range purely from the timing's DSC policy and picks the highest bpp the native DP link can carry, which overflows the smaller USB4 tunnel budget on a dock that fans out via an internal MST hub.
Apply the equivalent policy in compute_mst_dsc_configs_for_link(): when the link is a USB4 DPIA with BW allocation enabled, force DSC on (so the fairness pass does not leave a stream uncompressed just because the native link looks large enough) and pin the target to the minimum bpp (so the compressed stream fits the tunnel and reserves headroom for the other tunnels on the same host router). Reviewed-by: Roman Li <[email protected]> Signed-off-by: Fangzhi Zuo <[email protected]> Signed-off-by: Chenyu Chen <[email protected]> --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index b6b7fd7f8bca..a5b15bef8aa0 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -1375,6 +1375,10 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_commit *state, params[count].num_slices_v = aconnector->dsc_settings.dsc_num_slices_v; params[count].bpp_overwrite = aconnector->dsc_settings.dsc_bits_per_pixel; params[count].compression_possible = stream->sink->dsc_caps.dsc_dec_caps.is_dsc_supported; + if (params[count].compression_possible && + dc_link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA && + dc_link->dpia_bw_alloc_config.bw_alloc_enabled) + params[count].clock_force_enable = DSC_CLK_FORCE_ENABLE; dc_dsc_get_policy_for_timing(params[count].timing, 0, &dsc_policy, dc_link_get_highest_encoding_format(stream->link)); is_frl_endpoint_present = get_conv_frl_bw(aconnector, &frl_conv_bw_in_kbps, &frl_conv_dsc_bw_in_kbps); if (stream->sink->dsc_caps.dsc_dec_caps.is_dsc_supported && @@ -1386,7 +1390,10 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_commit *state, stream->sink->ctx->dc->res_pool->dscs[0], stream->sink->ctx->dc->debug.dsc_min_slice_height_override, dsc_policy.min_target_bpp * 16, - dsc_policy.max_target_bpp * 16, + (dc_link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA && + dc_link->dpia_bw_alloc_config.bw_alloc_enabled) ? + dsc_policy.min_target_bpp * 16 : + dsc_policy.max_target_bpp * 16, &stream->sink->dsc_caps.dsc_dec_caps, &stream->timing, dc_link_get_highest_encoding_format(dc_link), -- 2.43.0
