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

drm/i915: Pass the whole atomic state to intel_color_prepare_commit()



We'll have need to examine both the old and new crtc states in
intel_color_prepare_commit(), so let's just pass in the whole
atomic state.

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


Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 294ffd2b
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1902,15 +1902,20 @@ void intel_color_post_update(const struct intel_crtc_state *crtc_state)
		i915->display.funcs.color->color_post_update(crtc_state);
}

void intel_color_prepare_commit(struct intel_crtc_state *crtc_state)
void intel_color_prepare_commit(struct intel_atomic_state *state,
				struct intel_crtc *crtc)
{
	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
	struct drm_i915_private *i915 = to_i915(state->base.dev);
	struct intel_crtc_state *crtc_state =
		intel_atomic_get_new_crtc_state(state, crtc);

	if (!crtc_state->hw.active ||
	    intel_crtc_needs_modeset(crtc_state))
		return;

	if (!intel_crtc_needs_color_update(crtc_state))
		return;

	if (!crtc_state->pre_csc_lut && !crtc_state->post_csc_lut)
		return;

+2 −1
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@ int intel_color_init(struct drm_i915_private *i915);
void intel_color_crtc_init(struct intel_crtc *crtc);
int intel_color_check(struct intel_atomic_state *state,
		      struct intel_crtc *crtc);
void intel_color_prepare_commit(struct intel_crtc_state *crtc_state);
void intel_color_prepare_commit(struct intel_atomic_state *state,
				struct intel_crtc *crtc);
void intel_color_cleanup_commit(struct intel_crtc_state *crtc_state);
bool intel_color_uses_dsb(const struct intel_crtc_state *crtc_state);
void intel_color_wait_commit(const struct intel_crtc_state *crtc_state);
+3 −5
Original line number Diff line number Diff line
@@ -6718,7 +6718,7 @@ int intel_atomic_check(struct drm_device *dev,

static int intel_atomic_prepare_commit(struct intel_atomic_state *state)
{
	struct intel_crtc_state *crtc_state;
	struct intel_crtc_state __maybe_unused *crtc_state;
	struct intel_crtc *crtc;
	int i, ret;

@@ -6726,10 +6726,8 @@ static int intel_atomic_prepare_commit(struct intel_atomic_state *state)
	if (ret < 0)
		return ret;

	for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
		if (intel_crtc_needs_color_update(crtc_state))
			intel_color_prepare_commit(crtc_state);
	}
	for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i)
		intel_color_prepare_commit(state, crtc);

	return 0;
}