[PATCH 2/9] drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>

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@xxxxxxxxx>
Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux