[Intel-gfx] [PATCH 10/13] drm/i915: Reuse ilk_needs_fb_cb_tune() for the reduced clock as well

Ville Syrjala ville.syrjala at linux.intel.com
Thu Jul 15 09:35:27 UTC 2021


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Use ilk_needs_fb_cb_tune() for reduced_clock instead of hand rolling
it. Also ilk_needs_fb_cb_tune() can just use the precomputed M value
instead of calculating it again.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dpll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dpll.c b/drivers/gpu/drm/i915/display/intel_dpll.c
index 9b30d6e29a47..543890050040 100644
--- a/drivers/gpu/drm/i915/display/intel_dpll.c
+++ b/drivers/gpu/drm/i915/display/intel_dpll.c
@@ -952,7 +952,7 @@ static int hsw_crtc_compute_clock(struct intel_crtc_state *crtc_state)
 
 static bool ilk_needs_fb_cb_tune(const struct dpll *dpll, int factor)
 {
-	return i9xx_dpll_compute_m(dpll) < factor * dpll->n;
+	return dpll->m < factor * dpll->n;
 }
 
 static void ilk_update_pll_dividers(struct intel_crtc_state *crtc_state,
@@ -981,7 +981,7 @@ static void ilk_update_pll_dividers(struct intel_crtc_state *crtc_state,
 		fp |= FP_CB_TUNE;
 
 	fp2 = i9xx_dpll_compute_fp(reduced_clock);
-	if (reduced_clock->m < factor * reduced_clock->n)
+	if (ilk_needs_fb_cb_tune(reduced_clock, factor))
 		fp2 |= FP_CB_TUNE;
 
 	crtc_state->dpll_hw_state.fp0 = fp;
-- 
2.31.1



More information about the Intel-gfx mailing list