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: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240412182703.19916-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
3705cb818b
commit
897e85de17
@ -1213,23 +1213,25 @@ static bool ilk_needs_fb_cb_tune(const struct dpll *dpll, int factor)
|
||||
return dpll->m < factor * dpll->n;
|
||||
}
|
||||
|
||||
static void ilk_update_pll_dividers(struct intel_crtc_state *crtc_state,
|
||||
const struct dpll *clock,
|
||||
const struct dpll *reduced_clock)
|
||||
static u32 ilk_dpll_compute_fp(const struct dpll *clock, int factor)
|
||||
{
|
||||
int factor = ilk_fb_cb_factor(crtc_state);
|
||||
u32 fp, fp2;
|
||||
u32 fp;
|
||||
|
||||
fp = i9xx_dpll_compute_fp(clock);
|
||||
if (ilk_needs_fb_cb_tune(clock, factor))
|
||||
fp |= FP_CB_TUNE;
|
||||
|
||||
fp2 = i9xx_dpll_compute_fp(reduced_clock);
|
||||
if (ilk_needs_fb_cb_tune(reduced_clock, factor))
|
||||
fp2 |= FP_CB_TUNE;
|
||||
return fp;
|
||||
}
|
||||
|
||||
crtc_state->dpll_hw_state.fp0 = fp;
|
||||
crtc_state->dpll_hw_state.fp1 = fp2;
|
||||
static void ilk_update_pll_dividers(struct intel_crtc_state *crtc_state,
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user