Re: [PATCH 01/14] drm/i915/dp: Iterate DSC BPP from high to low on all platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 1/31/2025 6:19 PM, 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 <ankit.k.nautiyal@xxxxxxxxx>
Cc: Imre Deak <imre.deak@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # v6.7+
Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>

Thanks for the fix. I think I intended to iterate from max to min in initial version of the patch (atleast the one sent to trybot [1]), but some how messed it up while rebasing.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@xxxxxxxxx>

[1] https://lists.freedesktop.org/archives/intel-gfx-trybot/2022-June/129432.html

---
  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,



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux