diff mbox series

[10/14] drm/i915: Move state dump to the end of atomic_check()

Message ID 20190517193132.8140-10-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [01/14] drm/i915: Pass intel_atomic_state to cdclk funcs | expand

Commit Message

Ville Syrjälä May 17, 2019, 7:31 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Currently we're dumping the crtc states before they have
been fully calculated. Move the dumping to the end of
.atomic_check() so we get a fully up to date dump.

Let's also do the dump for fully disabled pipes, but we'll
limit that to just saying that the pipe is disabled since
the rest of the state is going to be nonsense in that case.

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

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e71a90a47d3a..5ffb4f5c4fa7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11488,8 +11488,9 @@  static void intel_dump_pipe_config(struct intel_crtc_state *pipe_config,
 	struct drm_framebuffer *fb;
 	char buf[64];
 
-	DRM_DEBUG_KMS("[CRTC:%d:%s]%s\n",
-		      crtc->base.base.id, crtc->base.name, context);
+	DRM_DEBUG_KMS("[CRTC:%d:%s] enable: %s %s\n",
+		      crtc->base.base.id, crtc->base.name,
+		      yesno(pipe_config->base.enable), context);
 
 	snprintf_output_types(buf, sizeof(buf), pipe_config->output_types);
 	DRM_DEBUG_KMS("output_types: %s (0x%x)\n",
@@ -13081,10 +13082,6 @@  static int intel_atomic_check(struct drm_device *dev,
 
 		if (needs_modeset(&new_crtc_state->base))
 			any_ms = true;
-
-		intel_dump_pipe_config(new_crtc_state,
-				       needs_modeset(&new_crtc_state->base) ?
-				       "[modeset]" : "[fastset]");
 	}
 
 	ret = drm_dp_mst_atomic_check(&state->base);
@@ -13108,7 +13105,23 @@  static int intel_atomic_check(struct drm_device *dev,
 		return ret;
 
 	intel_fbc_choose_crtc(dev_priv, state);
-	return calc_watermark_data(state);
+
+	ret = calc_watermark_data(state);
+	if (ret)
+		return ret;
+
+	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
+					    new_crtc_state, i) {
+		if (!needs_modeset(&new_crtc_state->base) &&
+		    !new_crtc_state->update_pipe)
+			continue;
+
+		intel_dump_pipe_config(new_crtc_state,
+				       needs_modeset(&new_crtc_state->base) ?
+				       "[modeset]" : "[fastset]");
+	}
+
+	return 0;
 }
 
 static int intel_atomic_prepare_commit(struct drm_device *dev,