OSDN Git Service

drm/i915: Reuse ilk_needs_fb_cb_tune() for the reduced clock as well
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 15 Jul 2021 09:35:27 +0000 (12:35 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 25 Aug 2021 14:13:53 +0000 (17:13 +0300)
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@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210715093530.31711-11-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_dpll.c

index 13d99f3..381f6ea 100644 (file)
@@ -954,7 +954,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,
@@ -983,7 +983,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;