On Fri, Jan 31, 2025 at 02:49:54PM +0200, Jani Nikula wrote:
> Commit 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best
> compressed bpp") tries to find the best compressed bpp for the
> link. However, it iterates from max to min bpp on display 13+, and from
> min to max on other platforms. This presumably leads to minimum
> compressed bpp always being chosen on display 11-12.
> 
> Iterate from high to low on all platforms to actually use the best
> possible compressed bpp.
> 
> Fixes: 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best 
> compressed bpp")
> Cc: Ankit Nautiyal <[email protected]>
> Cc: Imre Deak <[email protected]>
> Cc: <[email protected]> # v6.7+
> Signed-off-by: Jani Nikula <[email protected]>

Reviewed-by: Imre Deak <[email protected]>

> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index d1b4fd542a1f..ecf192262eb9 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2073,11 +2073,10 @@ icl_dsc_compute_link_config(struct intel_dp *intel_dp,
>       /* Compressed BPP should be less than the Input DSC bpp */
>       dsc_max_bpp = min(dsc_max_bpp, output_bpp - 1);
>  
> -     for (i = 0; i < ARRAY_SIZE(valid_dsc_bpp); i++) {
> -             if (valid_dsc_bpp[i] < dsc_min_bpp)
> +     for (i = ARRAY_SIZE(valid_dsc_bpp) - 1; i >= 0; i--) {
> +             if (valid_dsc_bpp[i] < dsc_min_bpp ||
> +                 valid_dsc_bpp[i] > dsc_max_bpp)
>                       continue;
> -             if (valid_dsc_bpp[i] > dsc_max_bpp)
> -                     break;
>  
>               ret = dsc_compute_link_config(intel_dp,
>                                             pipe_config,
> -- 
> 2.39.5
> 

Reply via email to