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

drm/i915/cdclk: Decouple cdclk from state->modeset



There's no real reason anymore to tie cdclk updates to
state->modeset/any_ms. Always call the cdclk functions and
allow them to decide whether cdclk update is necessary/desired
or not.

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


Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
parent 3d23ce8c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2708,6 +2708,9 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state)
	struct intel_cdclk_config cdclk_config;
	enum pipe pipe;

	if (!new_cdclk_state)
		return;

	if (!intel_cdclk_changed(&old_cdclk_state->actual,
				 &new_cdclk_state->actual))
		return;
@@ -2760,6 +2763,9 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state)
		intel_atomic_get_new_cdclk_state(state);
	enum pipe pipe;

	if (!new_cdclk_state)
		return;

	if (!intel_cdclk_changed(&old_cdclk_state->actual,
				 &new_cdclk_state->actual))
		return;
+8 −6
Original line number Diff line number Diff line
@@ -6305,6 +6305,7 @@ int intel_atomic_check(struct drm_device *dev,
	struct intel_atomic_state *state = to_intel_atomic_state(_state);
	struct intel_crtc_state *old_crtc_state, *new_crtc_state;
	struct intel_crtc *crtc;
	bool need_cdclk_calc = false;
	int ret, i;
	bool any_ms = false;

@@ -6438,7 +6439,7 @@ int intel_atomic_check(struct drm_device *dev,
	if (ret)
		goto fail;

	ret = intel_cdclk_atomic_check(state, &any_ms);
	ret = intel_cdclk_atomic_check(state, &need_cdclk_calc);
	if (ret)
		goto fail;

@@ -6449,7 +6450,9 @@ int intel_atomic_check(struct drm_device *dev,
		ret = intel_modeset_checks(state);
		if (ret)
			goto fail;
	}

	if (need_cdclk_calc) {
		ret = intel_modeset_calc_cdclk(state);
		if (ret)
			return ret;
@@ -7361,13 +7364,13 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
	 */
	intel_pmdemand_pre_plane_update(state);

	if (state->modeset) {
	if (state->modeset)
		drm_atomic_helper_update_legacy_modeset_state(display->drm, &state->base);

	intel_set_cdclk_pre_plane_update(state);

	if (state->modeset)
		intel_modeset_verify_disabled(state);
	}

	intel_sagv_pre_plane_update(state);

@@ -7480,7 +7483,6 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
		intel_verify_planes(state);

	intel_sagv_post_plane_update(state);
	if (state->modeset)
	intel_set_cdclk_post_plane_update(state);
	intel_pmdemand_post_plane_update(state);