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 3/5] drm/i915: Reorganize plane/fb dump in debugfs
Date: Tue, 29 Oct 2019 17:16:12 +0200	[thread overview]
Message-ID: <20191029151614.16929-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20191029151614.16929-1-ville.syrjala@linux.intel.com>

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

Eliminate the special cases for the primary and cursor planes and just
dump all the information consistently for all the planes.

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

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 6335bfbe4a06..a35a383f1dd9 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2405,27 +2405,6 @@ static void intel_encoder_info(struct seq_file *m,
 	}
 }
 
-static void intel_crtc_info(struct seq_file *m, struct intel_crtc *crtc)
-{
-	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	struct drm_device *dev = &dev_priv->drm;
-	struct intel_encoder *encoder;
-	struct intel_plane *plane = to_intel_plane(crtc->base.primary);
-	const struct intel_plane_state *plane_state =
-		to_intel_plane_state(plane->base.state);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-
-	if (fb)
-		seq_printf(m, "\tfb: %d, pos: %dx%d, size: %dx%d\n",
-			   fb->base.id, plane_state->base.src_x >> 16,
-			   plane_state->base.src_y >> 16,
-			   fb->width, fb->height);
-	else
-		seq_puts(m, "\tprimary plane disabled\n");
-	for_each_encoder_on_crtc(dev, &crtc->base, encoder)
-		intel_encoder_info(m, crtc, encoder);
-}
-
 static void intel_panel_info(struct seq_file *m, struct intel_panel *panel)
 {
 	struct drm_display_mode *mode = panel->fixed_mode;
@@ -2611,22 +2590,24 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *crtc)
 
 		src = drm_plane_state_src(&plane_state->base);
 		dst = drm_plane_state_dest(&plane_state->base);
-		fb = plane_state->base.fb;
 
+		fb = plane_state->base.fb;
 		if (fb)
 			drm_get_format_name(fb->format->format, &format_name);
-		else
-			sprintf(format_name.str, "N/A");
 
 		plane_rotation(rot_str, sizeof(rot_str),
 			       plane_state->base.rotation);
 
-		seq_printf(m, "\t--Plane id %d: type=%s, dst=" DRM_RECT_FMT ", src=" DRM_RECT_FP_FMT ", format=%s, rotation=%s\n",
+		seq_printf(m, "\t--Plane id %d: type=%s, fb=%d,%s,%dx%d, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
 			   plane->base.base.id,
 			   plane_type(plane->base.type),
-			   DRM_RECT_ARG(&dst),
+			   fb ? fb->base.id : 0,
+			   fb ? format_name.str : "n/a",
+			   fb ? fb->width : 0,
+			   fb ? fb->height : 0,
 			   DRM_RECT_FP_ARG(&src),
-			   format_name.str, rot_str);
+			   DRM_RECT_ARG(&dst),
+			   rot_str);
 	}
 }
 
@@ -2684,18 +2665,11 @@ static int i915_display_info(struct seq_file *m, void *unused)
 			   yesno(crtc_state->dither), crtc_state->pipe_bpp);
 
 		if (crtc_state->base.active) {
-			struct intel_plane *cursor =
-				to_intel_plane(crtc->base.cursor);
-
-			intel_crtc_info(m, crtc);
-
-			seq_printf(m, "\tcursor visible? %s, position (%d, %d), size %dx%d, addr 0x%08x\n",
-				   yesno(cursor->base.state->visible),
-				   cursor->base.state->crtc_x,
-				   cursor->base.state->crtc_y,
-				   cursor->base.state->crtc_w,
-				   cursor->base.state->crtc_h,
-				   cursor->cursor.base);
+			struct intel_encoder *encoder;
+
+			for_each_encoder_on_crtc(dev, &crtc->base, encoder)
+				intel_encoder_info(m, crtc, encoder);
+
 			intel_scaler_info(m, crtc);
 			intel_plane_info(m, crtc);
 		}
-- 
2.23.0

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

WARNING: multiple messages have this Message-ID (diff)
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 3/5] drm/i915: Reorganize plane/fb dump in debugfs
Date: Tue, 29 Oct 2019 17:16:12 +0200	[thread overview]
Message-ID: <20191029151614.16929-3-ville.syrjala@linux.intel.com> (raw)
Message-ID: <20191029151612.Pl80HhQ3vQzhoxs8f3XsB0kDJbKiRwz1v_TFD5O5lek@z> (raw)
In-Reply-To: <20191029151614.16929-1-ville.syrjala@linux.intel.com>

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

Eliminate the special cases for the primary and cursor planes and just
dump all the information consistently for all the planes.

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

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 6335bfbe4a06..a35a383f1dd9 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2405,27 +2405,6 @@ static void intel_encoder_info(struct seq_file *m,
 	}
 }
 
-static void intel_crtc_info(struct seq_file *m, struct intel_crtc *crtc)
-{
-	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	struct drm_device *dev = &dev_priv->drm;
-	struct intel_encoder *encoder;
-	struct intel_plane *plane = to_intel_plane(crtc->base.primary);
-	const struct intel_plane_state *plane_state =
-		to_intel_plane_state(plane->base.state);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-
-	if (fb)
-		seq_printf(m, "\tfb: %d, pos: %dx%d, size: %dx%d\n",
-			   fb->base.id, plane_state->base.src_x >> 16,
-			   plane_state->base.src_y >> 16,
-			   fb->width, fb->height);
-	else
-		seq_puts(m, "\tprimary plane disabled\n");
-	for_each_encoder_on_crtc(dev, &crtc->base, encoder)
-		intel_encoder_info(m, crtc, encoder);
-}
-
 static void intel_panel_info(struct seq_file *m, struct intel_panel *panel)
 {
 	struct drm_display_mode *mode = panel->fixed_mode;
@@ -2611,22 +2590,24 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *crtc)
 
 		src = drm_plane_state_src(&plane_state->base);
 		dst = drm_plane_state_dest(&plane_state->base);
-		fb = plane_state->base.fb;
 
+		fb = plane_state->base.fb;
 		if (fb)
 			drm_get_format_name(fb->format->format, &format_name);
-		else
-			sprintf(format_name.str, "N/A");
 
 		plane_rotation(rot_str, sizeof(rot_str),
 			       plane_state->base.rotation);
 
-		seq_printf(m, "\t--Plane id %d: type=%s, dst=" DRM_RECT_FMT ", src=" DRM_RECT_FP_FMT ", format=%s, rotation=%s\n",
+		seq_printf(m, "\t--Plane id %d: type=%s, fb=%d,%s,%dx%d, src=" DRM_RECT_FP_FMT ", dst=" DRM_RECT_FMT ", rotation=%s\n",
 			   plane->base.base.id,
 			   plane_type(plane->base.type),
-			   DRM_RECT_ARG(&dst),
+			   fb ? fb->base.id : 0,
+			   fb ? format_name.str : "n/a",
+			   fb ? fb->width : 0,
+			   fb ? fb->height : 0,
 			   DRM_RECT_FP_ARG(&src),
-			   format_name.str, rot_str);
+			   DRM_RECT_ARG(&dst),
+			   rot_str);
 	}
 }
 
@@ -2684,18 +2665,11 @@ static int i915_display_info(struct seq_file *m, void *unused)
 			   yesno(crtc_state->dither), crtc_state->pipe_bpp);
 
 		if (crtc_state->base.active) {
-			struct intel_plane *cursor =
-				to_intel_plane(crtc->base.cursor);
-
-			intel_crtc_info(m, crtc);
-
-			seq_printf(m, "\tcursor visible? %s, position (%d, %d), size %dx%d, addr 0x%08x\n",
-				   yesno(cursor->base.state->visible),
-				   cursor->base.state->crtc_x,
-				   cursor->base.state->crtc_y,
-				   cursor->base.state->crtc_w,
-				   cursor->base.state->crtc_h,
-				   cursor->cursor.base);
+			struct intel_encoder *encoder;
+
+			for_each_encoder_on_crtc(dev, &crtc->base, encoder)
+				intel_encoder_info(m, crtc, encoder);
+
 			intel_scaler_info(m, crtc);
 			intel_plane_info(m, crtc);
 		}
-- 
2.23.0

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

  parent reply	other threads:[~2019-10-29 15:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 15:16 [PATCH 1/5] drm/i915: Use drm_rect to simplify plane {crtc, src}_{x, y, w, h} printing Ville Syrjala
2019-10-29 15:16 ` [Intel-gfx] " Ville Syrjala
2019-10-29 15:16 ` [PATCH 2/5] drm/i915: Switch to intel_ types in debugfs display_info Ville Syrjala
2019-10-29 15:16   ` [Intel-gfx] " Ville Syrjala
2019-10-29 15:16 ` Ville Syrjala [this message]
2019-10-29 15:16   ` [Intel-gfx] [PATCH 3/5] drm/i915: Reorganize plane/fb dump in debugfs Ville Syrjala
2019-10-29 15:16 ` [PATCH 4/5] drm/i915: Refactor debugfs display info code Ville Syrjala
2019-10-29 15:16   ` [Intel-gfx] " Ville Syrjala
2019-10-29 15:16 ` [PATCH 5/5] drm/i915: Dump the mode for the crtc just the once Ville Syrjala
2019-10-29 15:16   ` [Intel-gfx] " Ville Syrjala
2019-10-29 20:00 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/i915: Use drm_rect to simplify plane {crtc, src}_{x, y, w, h} printing Patchwork
2019-10-29 20:00   ` [Intel-gfx] " Patchwork
2019-10-29 20:21 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-29 20:21   ` [Intel-gfx] " Patchwork
2019-10-30 15:50 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-10-30 15:50   ` [Intel-gfx] " Patchwork

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=20191029151614.16929-3-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.