]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/i915/dp: Specify the FEC overhead as an increment vs. a remainder
authorImre Deak <imre.deak@intel.com>
Tue, 24 Oct 2023 01:09:06 +0000 (04:09 +0300)
committerImre Deak <imre.deak@intel.com>
Wed, 8 Nov 2023 15:22:11 +0000 (17:22 +0200)
A follow-up patch will add up all the overheads on a DP link, where it
makes more sense to specify each overhead factor in terms of the added
overhead amount vs. the reciprocal remainder (of usable BW remaining
after deducting the overhead). Prepare for that here, keeping the
existing behavior.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231030155843.2251023-12-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index 516671f50b6c486a0c9778ac3fae0065d34ee79e..6186926f865ef71c2444dc8a5de2b9d65e8a86a2 100644 (file)
@@ -85,8 +85,8 @@
 #define DP_DSC_MAX_ENC_THROUGHPUT_0            340000
 #define DP_DSC_MAX_ENC_THROUGHPUT_1            400000
 
-/* DP DSC FEC Overhead factor = 1/(0.972261) */
-#define DP_DSC_FEC_OVERHEAD_FACTOR             972261
+/* DP DSC FEC Overhead factor in ppm = 1/(0.972261) = 1.028530 */
+#define DP_DSC_FEC_OVERHEAD_FACTOR             1028530
 
 /* Compliance test status bits  */
 #define INTEL_DP_RESOLUTION_SHIFT_MASK 0
@@ -680,8 +680,8 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
 
 u32 intel_dp_mode_to_fec_clock(u32 mode_clock)
 {
-       return div_u64(mul_u32_u32(mode_clock, 1000000U),
-                      DP_DSC_FEC_OVERHEAD_FACTOR);
+       return div_u64(mul_u32_u32(mode_clock, DP_DSC_FEC_OVERHEAD_FACTOR),
+                      1000000U);
 }
 
 static int