Commit 155a2717 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Move stuff into intel_dpll_crtc_compute_clock()



Move some checks into intel_dpll_crtc_compute_clock() from the
caller. Avoids the caller from having to worry about all this
crap.

We'll also reorder the hw.enable vs. shared_dpll checks since
it makes sense to sanity check that we've cleared out the
old shared_dpll even if the pipe is getting disabled.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-6-ville.syrjala@linux.intel.com


Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 7275f630
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -4904,8 +4904,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
	    mode_changed && !crtc_state->hw.active)
		crtc_state->update_wm_post = true;

	if (mode_changed && crtc_state->hw.enable &&
	    !drm_WARN_ON(&dev_priv->drm, crtc_state->shared_dpll)) {
	if (mode_changed) {
		ret = intel_dpll_crtc_compute_clock(state, crtc);
		if (ret)
			return ret;
+10 −0
Original line number Diff line number Diff line
@@ -1419,6 +1419,16 @@ int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state,
				  struct intel_crtc *crtc)
{
	struct drm_i915_private *i915 = to_i915(state->base.dev);
	struct intel_crtc_state *crtc_state =
		intel_atomic_get_new_crtc_state(state, crtc);

	drm_WARN_ON(&i915->drm, !intel_crtc_needs_modeset(crtc_state));

	if (drm_WARN_ON(&i915->drm, crtc_state->shared_dpll))
		return 0;

	if (!crtc_state->hw.enable)
		return 0;

	return i915->dpll_funcs->crtc_compute_clock(state, crtc);
}