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

drm/i915: Utilize intel_crtc_joined_pipe_mask() more



Unify the master vs. slave handling in
intel_ddi_post_disable_hdmi_or_sst() by looping over all the
pipes in one go.

This also lets us move the intel_crtc_vblank_off() calls to
happen in a consistent place vs. the transcoder disable.
Previously we did the master vs. slaves on different sides
of that.

v2: Use the name 'pipe_crtc' for the per-pipe crtc pointer

Tested-by: default avatarVidya Srinivas <vidya.srinivas@intel.com>
Reviewed-by: default avatarArun R Murthy <arun.r.murthy@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240409163502.29633-3-ville.syrjala@linux.intel.com
parent f3b93eae
Loading
Loading
Loading
Loading
+17 −16
Original line number Diff line number Diff line
@@ -3097,30 +3097,31 @@ static void intel_ddi_post_disable_hdmi_or_sst(struct intel_atomic_state *state,
					       const struct drm_connector_state *old_conn_state)
{
	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
	struct intel_crtc *slave_crtc;
	struct intel_crtc *pipe_crtc;

	for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
					 intel_crtc_joined_pipe_mask(old_crtc_state)) {
		const struct intel_crtc_state *old_pipe_crtc_state =
			intel_atomic_get_old_crtc_state(state, pipe_crtc);

	intel_crtc_vblank_off(old_crtc_state);
		intel_crtc_vblank_off(old_pipe_crtc_state);
	}

	intel_disable_transcoder(old_crtc_state);

	intel_ddi_disable_transcoder_func(old_crtc_state);

	intel_dsc_disable(old_crtc_state);
	for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
					 intel_crtc_joined_pipe_mask(old_crtc_state)) {
		const struct intel_crtc_state *old_pipe_crtc_state =
			intel_atomic_get_old_crtc_state(state, pipe_crtc);

		intel_dsc_disable(old_pipe_crtc_state);

		if (DISPLAY_VER(dev_priv) >= 9)
		skl_scaler_disable(old_crtc_state);
			skl_scaler_disable(old_pipe_crtc_state);
		else
		ilk_pfit_disable(old_crtc_state);

	for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, slave_crtc,
					 intel_crtc_bigjoiner_slave_pipes(old_crtc_state)) {
		const struct intel_crtc_state *old_slave_crtc_state =
			intel_atomic_get_old_crtc_state(state, slave_crtc);

		intel_crtc_vblank_off(old_slave_crtc_state);

		intel_dsc_disable(old_slave_crtc_state);
		skl_scaler_disable(old_slave_crtc_state);
			ilk_pfit_disable(old_pipe_crtc_state);
	}
}