[PATCH 27/27] drm/i915/dsc: Allow DSC only with fractional bpp when forced from debugfs

Ankit Nautiyal ankit.k.nautiyal at intel.com
Thu Jun 15 13:00:50 UTC 2023


From: Swati Sharma <swati2.sharma at intel.com>

If force_dsc_fractional_bpp_en is set through debugfs allow DSC iff
compressed bpp is fractional. Continue if we computed compressed bpp is
computed as integer.

Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index b7c8ac47d8c2..ebcd19110c73 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1863,6 +1863,9 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
 	for (compressed_bppx16 = dsc_max_bpp << 4;
 	     compressed_bppx16 >= dsc_min_bpp << 4;
 	     compressed_bppx16 -= bppx16_step) {
+		if (intel_dp->force_dsc_fractional_bpp_en &&
+		    !dsc_fractional_compressed_bpp(compressed_bppx16))
+			continue;
 		ret = dsc_compute_link_config(intel_dp,
 					      pipe_config,
 					      limits,
@@ -1871,6 +1874,11 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
 					      timeslots);
 		if (ret == 0) {
 			pipe_config->dsc.compressed_bpp = compressed_bppx16;
+
+			if (intel_dp->force_dsc_fractional_bpp_en &&
+			    dsc_fractional_compressed_bpp(compressed_bppx16))
+				drm_dbg_kms(&i915->drm, "Forcing DSC fractional bpp\n");
+
 			return 0;
 		}
 	}
-- 
2.40.1



More information about the Intel-gfx-trybot mailing list