[PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Apr 27 10:06:54 UTC 2016


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

Purpose is to enable drivers to print out just the mode
string with their own formatting.

Existing drm_mode_debug_printmodeline calls the new
helper and the format is unchanged in this patch.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: dri-devel at lists.freedesktop.org
---
 drivers/gpu/drm/drm_modes.c | 29 ++++++++++++++++++++++-------
 include/drm/drm_modes.h     |  1 +
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 7def3d58da18..fd4795e2c8db 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -42,6 +42,24 @@
 #include "drm_crtc_internal.h"
 
 /**
+ * drm_mode_debug_printmodeline_raw - print a mode raw string to dmesg
+ * @mode: mode to print
+ *
+ * Describe @mode using DRM_DEBUG without the loglevel, drm prefix and newline.
+ */
+void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode)
+{
+	if (drm_debug & DRM_UT_KMS)
+		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);
+}
+EXPORT_SYMBOL(drm_mode_debug_printmodeline_raw);
+
+/**
  * drm_mode_debug_printmodeline - print a mode to dmesg
  * @mode: mode to print
  *
@@ -49,13 +67,10 @@
  */
 void drm_mode_debug_printmodeline(const struct drm_display_mode *mode)
 {
-	DRM_DEBUG_KMS("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d "
-			"0x%x 0x%x\n",
-		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);
+	DRM_DEBUG_KMS("Modeline ");
+	drm_mode_debug_printmodeline_raw(mode);
+	if (drm_debug & DRM_UT_KMS)
+		printk("\n");
 }
 EXPORT_SYMBOL(drm_mode_debug_printmodeline);
 
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index 625966a906f2..9bb0cd06b80e 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -437,6 +437,7 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
 			   const struct drm_mode_modeinfo *in);
 void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
 void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
+void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode);
 
 struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
 				      int hdisplay, int vdisplay, int vrefresh,
-- 
1.9.1



More information about the dri-devel mailing list