Skip to content

Commit

Permalink
drm/i915/dpll: add intel_dpll_crtc_compute_clock()
Browse files Browse the repository at this point in the history
Avoid referencing the function pointer directly to be able to abstract
the call better.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/12ac40c1ef9915fe680c6657b603b08be022626b.1643896905.git.jani.nikula@intel.com
  • Loading branch information
Jani Nikula committed Feb 9, 2022
1 parent 91cb1e1 commit 11a1d09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/display/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -5266,7 +5266,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,

if (mode_changed && crtc_state->hw.enable &&
!drm_WARN_ON(&dev_priv->drm, crtc_state->shared_dpll)) {
ret = dev_priv->dpll_funcs->crtc_compute_clock(crtc_state);
ret = intel_dpll_crtc_compute_clock(crtc_state);
if (ret)
return ret;
}
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/i915/display/intel_dpll.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,14 @@ static const struct intel_dpll_funcs i8xx_dpll_funcs = {
.crtc_compute_clock = i8xx_crtc_compute_clock,
};

int intel_dpll_crtc_compute_clock(struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct drm_i915_private *i915 = to_i915(crtc->base.dev);

return i915->dpll_funcs->crtc_compute_clock(crtc_state);
}

void
intel_dpll_init_clock_hook(struct drm_i915_private *dev_priv)
{
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/intel_dpll.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct intel_crtc_state;
enum pipe;

void intel_dpll_init_clock_hook(struct drm_i915_private *dev_priv);
int intel_dpll_crtc_compute_clock(struct intel_crtc_state *crtc_state);
int vlv_calc_dpll_params(int refclk, struct dpll *clock);
int pnv_calc_dpll_params(int refclk, struct dpll *clock);
int i9xx_calc_dpll_params(int refclk, struct dpll *clock);
Expand Down

0 comments on commit 11a1d09

Please sign in to comment.