All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 12/14] drm/i915: Dump failed crtc states during atomic check
Date: Fri, 17 May 2019 22:31:30 +0300	[thread overview]
Message-ID: <20190517193132.8140-12-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190517193132.8140-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Currently we're only dumping the failed crtc state if
intel_modeset_pipe_config() fails. Let's do the state
dump if anything else fails afterwards. The downside
is that we lose the immediate knowledge which crtc caused
the failure (unless a lower level function indicates it
with an additional debug print) but having the full state
dumped seems like something that could be beneficial.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 34 ++++++++++++++++++----------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 59b012be9a4f..fe8dc7939529 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13051,7 +13051,7 @@ static int intel_atomic_check(struct drm_device *dev,
 
 	ret = drm_atomic_helper_check_modeset(dev, &state->base);
 	if (ret)
-		return ret;
+		goto fail;
 
 	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
 					    new_crtc_state, i) {
@@ -13064,12 +13064,8 @@ static int intel_atomic_check(struct drm_device *dev,
 		}
 
 		ret = intel_modeset_pipe_config(new_crtc_state);
-		if (ret == -EDEADLK)
-			return ret;
-		if (ret) {
-			intel_dump_pipe_config(new_crtc_state, "[failed]");
-			return ret;
-		}
+		if (ret)
+			goto fail;
 
 		if (intel_pipe_config_compare(dev_priv, old_crtc_state,
 					      new_crtc_state, true)) {
@@ -13083,29 +13079,29 @@ static int intel_atomic_check(struct drm_device *dev,
 
 	ret = drm_dp_mst_atomic_check(&state->base);
 	if (ret)
-		return ret;
+		goto fail;
 
 	if (any_ms) {
 		ret = intel_modeset_checks(state);
 		if (ret)
-			return ret;
+			goto fail;
 	} else {
 		state->cdclk.logical = dev_priv->cdclk.logical;
 	}
 
 	ret = icl_add_linked_planes(state);
 	if (ret)
-		return ret;
+		goto fail;
 
 	ret = drm_atomic_helper_check_planes(dev, &state->base);
 	if (ret)
-		return ret;
+		goto fail;
 
 	intel_fbc_choose_crtc(dev_priv, state);
 
 	ret = calc_watermark_data(state);
 	if (ret)
-		return ret;
+		goto fail;
 
 	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
 					    new_crtc_state, i) {
@@ -13119,6 +13115,20 @@ static int intel_atomic_check(struct drm_device *dev,
 	}
 
 	return 0;
+
+ fail:
+	if (ret == -EDEADLK)
+		return ret;
+
+	/*
+	 * FIXME would probably be nice to know which crtc specifically
+	 * caused the failure, in cases where we can pinpoint it.
+	 */
+	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
+					    new_crtc_state, i)
+		intel_dump_pipe_config(new_crtc_state, "[failed]");
+
+	return ret;
 }
 
 static int intel_atomic_prepare_commit(struct drm_device *dev,
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-05-17 19:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 19:31 [PATCH 01/14] drm/i915: Pass intel_atomic_state to cdclk funcs Ville Syrjala
2019-05-17 19:31 ` [PATCH 02/14] drm/i915: Clean up cdclk vfunc assignments Ville Syrjala
2019-05-17 19:31 ` [PATCH 03/14] drm/i915: Pass intel_atomic state to check_digital_port_conflicts() Ville Syrjala
2019-05-17 19:31 ` [PATCH 04/14] drm/i915: Use intel_ types in intel_modeset_clear_plls() Ville Syrjala
2019-05-17 19:31 ` [PATCH 05/14] drm/i915: Use intel_ types in haswell_mode_set_planes_workaround() Ville Syrjala
2019-05-17 19:31 ` [PATCH 06/14] drm/i915: Don't pass the crtc to intel_dump_pipe_config() Ville Syrjala
2019-05-17 19:31 ` [PATCH 07/14] drm/i915: Don't pass the crtc to intel_modeset_pipe_config() Ville Syrjala
2019-05-17 19:31 ` [PATCH 08/14] drm/i915: Use intel_ types in intel_modeset_checks() Ville Syrjala
2019-05-17 19:31 ` [PATCH 09/14] drm/i915: Use intel_ types in intel_atomic_check() Ville Syrjala
2019-05-17 19:31 ` [PATCH 10/14] drm/i915: Move state dump to the end of atomic_check() Ville Syrjala
2019-05-17 19:31 ` [PATCH 11/14] drm/i915: Include crtc_state.active in crtc state dumps Ville Syrjala
2019-05-17 19:31 ` Ville Syrjala [this message]
2019-05-17 19:31 ` [PATCH 13/14] drm/i915: Make state dumpers take a const state Ville Syrjala
2019-05-17 19:31 ` [PATCH 14/14] drm/i915: Fix plane state dumps Ville Syrjala
2019-05-17 19:57 ` ✗ Fi.CI.SPARSE: warning for series starting with [01/14] drm/i915: Pass intel_atomic_state to cdclk funcs Patchwork
2019-05-17 20:12 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-18 10:33 ` ✓ Fi.CI.IGT: " Patchwork
2019-06-04 13:45 ` [PATCH 01/14] " Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190517193132.8140-12-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.