All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [PATCH 2/9] drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw)
Date: Wed, 27 Apr 2016 11:06:55 +0100	[thread overview]
Message-ID: <1461751622-26927-3-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1461751622-26927-1-git-send-email-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Instead of a long string full of zeros in various forms
print out "---" for more tidy appearace in the logs.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_modes.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index fd4795e2c8db..da9012dc4bba 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -49,13 +49,26 @@
  */
 void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode)
 {
-	if (drm_debug & DRM_UT_KMS)
+	if (!(drm_debug & DRM_UT_KMS))
+		return;
+
+	if (mode->base.id == 0 &&
+	    (mode->name == NULL || mode->name[0] == 0) &&
+	    mode->vrefresh == 0 && mode->clock == 0 &&
+	    mode->hdisplay == 0 && mode->hsync_start == 0 &&
+	    mode->hsync_end == 0 && mode->htotal == 0 &&
+	    mode->vdisplay == 0 && mode->vsync_start == 0 &&
+	    mode->vsync_end == 0 && mode->vtotal == 0 &&
+	    mode->type == 0 && mode->flags == 0) {
+		printk("---");
+	} else {
 		printk("%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
-		       mode->base.id, mode->name, mode->vrefresh, mode->clock,
-		       mode->hdisplay, mode->hsync_start,
-		       mode->hsync_end, mode->htotal,
-		       mode->vdisplay, mode->vsync_start,
-		       mode->vsync_end, mode->vtotal, mode->type, mode->flags);
+			mode->base.id, mode->name, mode->vrefresh, mode->clock,
+			mode->hdisplay, mode->hsync_start,
+			mode->hsync_end, mode->htotal,
+			mode->vdisplay, mode->vsync_start,
+			mode->vsync_end, mode->vtotal, mode->type, mode->flags);
+	}
 }
 EXPORT_SYMBOL(drm_mode_debug_printmodeline_raw);
 
-- 
1.9.1

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

  parent reply	other threads:[~2016-04-27 10:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Tvrtko Ursulin
2016-04-27 12:35   ` Jani Nikula
2016-04-27 12:58     ` Tvrtko Ursulin
2016-04-27 10:06 ` Tvrtko Ursulin [this message]
2016-04-27 10:06 ` [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config Tvrtko Ursulin
2016-04-27 12:37   ` Jani Nikula
2016-04-27 10:06 ` [PATCH 4/9] drm/i915: Tidy planes and scaler info " Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 5/9] drm/i915: Compact intel_dump_pipe_config some more Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 6/9] drm/i915: Log watermark latencies on a single line per plane Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 7/9] drm/i915: Compact display clock logging Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 8/9] drm/i915: Print DisplayPort clocks on a single line Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 9/9] drm: Quiet down drm_mode_getconnector Tvrtko Ursulin
2016-04-28  8:54   ` Daniel Vetter
2016-04-27 10:54 ` [PATCH 0/9] A little bit of KMS debug logging tidy Jani Nikula
2016-04-27 11:26   ` Tvrtko Ursulin
2016-04-27 11:57 ` ✗ Fi.CI.BAT: warning for " 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=1461751622-26927-3-git-send-email-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    /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.