diff mbox series

[3/4] drm/i915: Don't flag both full modeset and fastset at the same time

Message ID 20221020120457.19528-4-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Clean up crtc state flag checks | expand

Commit Message

Ville Syrjälä Oct. 20, 2022, 12:04 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Be consistent in whether we flag a full modeset or a
fastset for the pipe. intel_modeset_all_pipes() would
seem to be the only codepath not getting this right.
And let's add a WARN to make sure we did get it right.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index b6004b3e6684..7b48ad20c548 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -5974,6 +5974,7 @@  int intel_modeset_all_pipes(struct intel_atomic_state *state,
 			    crtc->base.base.id, crtc->base.name, reason);
 
 		crtc_state->uapi.mode_changed = true;
+		crtc_state->update_pipe = false;
 
 		ret = drm_atomic_add_affected_connectors(&state->base,
 							 &crtc->base);
@@ -6925,6 +6926,11 @@  static int intel_atomic_check(struct drm_device *dev,
 		if (ret)
 			goto fail;
 
+		/* Either full modeset or fastset (or neither), never both */
+		drm_WARN_ON(&dev_priv->drm,
+			    intel_crtc_needs_modeset(new_crtc_state) &&
+			    intel_crtc_needs_fastset(new_crtc_state));
+
 		if (!intel_crtc_needs_modeset(new_crtc_state) &&
 		    !intel_crtc_needs_fastset(new_crtc_state))
 			continue;