All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 14/14] drm/i915: Add debug prints for encoder modeset hooks
Date: Tue,  8 Dec 2015 18:42:02 +0200	[thread overview]
Message-ID: <1449592922-5545-15-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1449592922-5545-1-git-send-email-ville.syrjala@linux.intel.com>

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

To get a better idea where exactly some error occurred during modeset,
put in some debug prints to tell us when the variuous encoder hooks are
getting called.

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f302d4af3c05..4904207a7c32 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4866,6 +4866,15 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_mask
 	intel_frontbuffer_flip(dev, INTEL_FRONTBUFFER_ALL_MASK(pipe));
 }
 
+#define intel_call_encoder_func(encoder, func) \
+do { \
+	if (!(encoder)->func) \
+		break; \
+	DRM_DEBUG_KMS("%s " #func " start\n", (encoder)->base.name); \
+	(encoder)->func(encoder); \
+	DRM_DEBUG_KMS("%s " #func " end\n", (encoder)->base.name); \
+} while (0)
+
 static void ironlake_crtc_enable(struct drm_crtc *crtc)
 {
 	struct drm_device *dev = crtc->dev;
@@ -4900,8 +4909,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 	intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->pre_enable)
-			encoder->pre_enable(encoder);
+		intel_call_encoder_func(encoder, pre_enable);
 
 	if (intel_crtc->config->has_pch_encoder) {
 		/* Note: FDI PLL enabling _must_ be done before we enable the
@@ -4931,7 +4939,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 	drm_crtc_vblank_on(crtc);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		encoder->enable(encoder);
+		intel_call_encoder_func(encoder, enable);
 
 	if (HAS_PCH_CPT(dev))
 		cpt_verify_modeset(dev, intel_crtc->pipe);
@@ -4996,10 +5004,8 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 	else
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
 
-	for_each_encoder_on_crtc(dev, crtc, encoder) {
-		if (encoder->pre_enable)
-			encoder->pre_enable(encoder);
-	}
+	for_each_encoder_on_crtc(dev, crtc, encoder)
+		intel_call_encoder_func(encoder, pre_enable);
 
 	if (intel_crtc->config->has_pch_encoder)
 		dev_priv->display.fdi_link_train(crtc);
@@ -5035,7 +5041,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
 	drm_crtc_vblank_on(crtc);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder) {
-		encoder->enable(encoder);
+		intel_call_encoder_func(encoder, enable);
 		intel_opregion_notify_encoder(encoder, true);
 	}
 
@@ -5085,7 +5091,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
 		intel_set_pch_fifo_underrun_reporting(dev_priv, pipe, false);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		encoder->disable(encoder);
+		intel_call_encoder_func(encoder, disable);
 
 	drm_crtc_vblank_off(crtc);
 	assert_vblank_disabled(crtc);
@@ -5108,8 +5114,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
 	}
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->post_disable)
-			encoder->post_disable(encoder);
+		intel_call_encoder_func(encoder, post_disable);
 
 	if (intel_crtc->config->has_pch_encoder) {
 		ironlake_disable_pch_transcoder(dev_priv, pipe);
@@ -5154,7 +5159,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
 
 	for_each_encoder_on_crtc(dev, crtc, encoder) {
 		intel_opregion_notify_encoder(encoder, false);
-		encoder->disable(encoder);
+		intel_call_encoder_func(encoder, disable);
 	}
 
 	drm_crtc_vblank_off(crtc);
@@ -5177,8 +5182,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
 		intel_ddi_disable_pipe_clock(intel_crtc);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->post_disable)
-			encoder->post_disable(encoder);
+		intel_call_encoder_func(encoder, post_disable);
 
 	if (intel_crtc->config->has_pch_encoder) {
 		lpt_disable_pch_transcoder(dev_priv);
@@ -6200,8 +6204,7 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
 	intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->pre_pll_enable)
-			encoder->pre_pll_enable(encoder);
+		intel_call_encoder_func(encoder, pre_pll_enable);
 
 	if (!intel_crtc->config->has_dsi_encoder) {
 		if (IS_CHERRYVIEW(dev)) {
@@ -6214,8 +6217,7 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
 	}
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->pre_enable)
-			encoder->pre_enable(encoder);
+		intel_call_encoder_func(encoder, pre_enable);
 
 	i9xx_pfit_enable(intel_crtc);
 
@@ -6227,7 +6229,7 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
 	drm_crtc_vblank_on(crtc);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		encoder->enable(encoder);
+		intel_call_encoder_func(encoder, enable);
 }
 
 static void i9xx_set_pll_dividers(struct intel_crtc *crtc)
@@ -6265,8 +6267,7 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc)
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->pre_enable)
-			encoder->pre_enable(encoder);
+		intel_call_encoder_func(encoder, pre_enable);
 
 	i9xx_enable_pll(intel_crtc);
 
@@ -6281,7 +6282,7 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc)
 	drm_crtc_vblank_on(crtc);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		encoder->enable(encoder);
+		intel_call_encoder_func(encoder, enable);
 
 	intel_fbc_enable(intel_crtc);
 }
@@ -6318,7 +6319,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
 	intel_wait_for_vblank(dev, pipe);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		encoder->disable(encoder);
+		intel_call_encoder_func(encoder, disable);
 
 	drm_crtc_vblank_off(crtc);
 	assert_vblank_disabled(crtc);
@@ -6328,8 +6329,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
 	i9xx_pfit_disable(intel_crtc);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->post_disable)
-			encoder->post_disable(encoder);
+		intel_call_encoder_func(encoder, post_disable);
 
 	if (!intel_crtc->config->has_dsi_encoder) {
 		if (IS_CHERRYVIEW(dev))
@@ -6341,8 +6341,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
 	}
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
-		if (encoder->post_pll_disable)
-			encoder->post_pll_disable(encoder);
+		intel_call_encoder_func(encoder, post_pll_disable);
 
 	if (!IS_GEN2(dev))
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
@@ -15527,9 +15526,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
 			DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n",
 				      encoder->base.base.id,
 				      encoder->base.name);
-			encoder->disable(encoder);
-			if (encoder->post_disable)
-				encoder->post_disable(encoder);
+			intel_call_encoder_func(encoder, disable);
+			intel_call_encoder_func(encoder, post_disable);
 		}
 		encoder->base.crtc = NULL;
 
-- 
2.4.10

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-12-08 16:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 16:41 [PATCH v4 00/14] drm: Give crtcs and planes actual names (v4) ville.syrjala
2015-12-08 16:41 ` [PATCH v2 01/14] drm: Pass 'name' to drm_crtc_init_with_planes() ville.syrjala
2015-12-09  8:21   ` [Intel-gfx] " Jani Nikula
2015-12-09 12:01     ` Ville Syrjälä
2015-12-09 14:19   ` [PATCH v3 " ville.syrjala
2015-12-08 16:41 ` [PATCH v2 02/14] drm: Pass 'name' to drm_universal_plane_init() ville.syrjala
2015-12-09 14:19   ` [PATCH v3 " ville.syrjala
2015-12-08 16:41 ` [PATCH 03/14] drm: Pass 'name' to drm_encoder_init() ville.syrjala
2015-12-09 14:20   ` [PATCH v2 " ville.syrjala
2015-12-08 16:41 ` [PATCH 04/14] drm: Use driver specified encoder name ville.syrjala
2015-12-09  7:32   ` [Intel-gfx] " Daniel Vetter
2015-12-09  7:33     ` Daniel Vetter
2015-12-09 11:56     ` Ville Syrjälä
2015-12-08 16:41 ` [PATCH v3 05/14] drm: Add crtc->name and use it in debug messages ville.syrjala
2015-12-08 16:41 ` [PATCH v3 06/14] drm: Add plane->name and use it in debug prints ville.syrjala
2015-12-11  8:17   ` Daniel Vetter
2015-12-08 16:41 ` [PATCH 07/14] drm/i915: Use crtc->name in debug messages ville.syrjala
2015-12-08 16:41 ` [PATCH 08/14] drm/i915: Use plane->name in debug prints ville.syrjala
2015-12-08 16:41 ` [PATCH v4 09/14] drm/i915: Set crtc->name to "pipe A", "pipe B", etc ville.syrjala
2015-12-08 16:41 ` [PATCH v3 10/14] drm/i915: Fix plane init failure paths ville.syrjala
2015-12-08 16:41 ` [PATCH 11/14] drm/i915: Don't leak primary/cursor planes on crtc init failure ville.syrjala
2015-12-08 16:42 ` [PATCH v3 12/14] drm/i915: Give meaningful names to all the planes ville.syrjala
2015-12-08 16:42 ` [PATCH 13/14] drm/i915: Give encoders useful names ville.syrjala
2015-12-09  8:35   ` [Intel-gfx] " Jani Nikula
2015-12-09 11:59     ` Ville Syrjälä
2015-12-09 13:50       ` Jani Nikula
2015-12-09 14:21   ` [PATCH v2 " ville.syrjala
2015-12-08 16:42 ` ville.syrjala [this message]
2015-12-09  8:53 ` [Intel-gfx] [PATCH v4 00/14] drm: Give crtcs and planes actual names (v4) Jani Nikula

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=1449592922-5545-15-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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.