Commit 897e85de authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Extract ilk_dpll_compute_fp()

Let's not repeat ourselves so much and pull the entire
PCH DPLL FP register value calculation into its own
function.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240412182703.19916-7-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 3705cb81
...@@ -1213,23 +1213,25 @@ static bool ilk_needs_fb_cb_tune(const struct dpll *dpll, int factor) ...@@ -1213,23 +1213,25 @@ static bool ilk_needs_fb_cb_tune(const struct dpll *dpll, int factor)
return dpll->m < factor * dpll->n; return dpll->m < factor * dpll->n;
} }
static void ilk_update_pll_dividers(struct intel_crtc_state *crtc_state, static u32 ilk_dpll_compute_fp(const struct dpll *clock, int factor)
const struct dpll *clock,
const struct dpll *reduced_clock)
{ {
int factor = ilk_fb_cb_factor(crtc_state); u32 fp;
u32 fp, fp2;
fp = i9xx_dpll_compute_fp(clock); fp = i9xx_dpll_compute_fp(clock);
if (ilk_needs_fb_cb_tune(clock, factor)) if (ilk_needs_fb_cb_tune(clock, factor))
fp |= FP_CB_TUNE; fp |= FP_CB_TUNE;
fp2 = i9xx_dpll_compute_fp(reduced_clock); return fp;
if (ilk_needs_fb_cb_tune(reduced_clock, factor)) }
fp2 |= FP_CB_TUNE;
crtc_state->dpll_hw_state.fp0 = fp; static void ilk_update_pll_dividers(struct intel_crtc_state *crtc_state,
crtc_state->dpll_hw_state.fp1 = fp2; const struct dpll *clock,
const struct dpll *reduced_clock)
{
int factor = ilk_fb_cb_factor(crtc_state);
crtc_state->dpll_hw_state.fp0 = ilk_dpll_compute_fp(clock, factor);
crtc_state->dpll_hw_state.fp1 = ilk_dpll_compute_fp(reduced_clock, factor);
} }
static void ilk_compute_dpll(struct intel_crtc_state *crtc_state, static void ilk_compute_dpll(struct intel_crtc_state *crtc_state,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment