[Intel-gfx] [CI 4/4] drm/i915/gt: Convert gen9+ frequency range to 50MHz increments

Chris Wilson chris at chris-wilson.co.uk
Sun Apr 19 09:46:11 UTC 2020


The RPS bins are in units of 33MHz, so if we want 50MHz increments, we
need 2/3, not 1/3!

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_llc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_llc.c b/drivers/gpu/drm/i915/gt/intel_llc.c
index e3f637b3650e..474d82a52859 100644
--- a/drivers/gpu/drm/i915/gt/intel_llc.c
+++ b/drivers/gpu/drm/i915/gt/intel_llc.c
@@ -67,8 +67,10 @@ static bool get_ia_constants(struct intel_llc *llc,
 	consts->max_gpu_freq = rps->max_freq;
 	if (INTEL_GEN(i915) >= 9) {
 		/* Convert GT frequency to 50 HZ units */
-		consts->min_gpu_freq /= GEN9_FREQ_SCALER;
-		consts->max_gpu_freq /= GEN9_FREQ_SCALER;
+		consts->min_gpu_freq =
+			mult_frac(consts->min_gpu_freq, 2, GEN9_FREQ_SCALER);
+		consts->max_gpu_freq =
+			mult_frac(consts->max_gpu_freq, 2, GEN9_FREQ_SCALER);
 	}
 
 	return true;
-- 
2.20.1



More information about the Intel-gfx mailing list