[RFC][PATCH] drm: Add DRM_DEBUG_DISPLAY macro for display configuration debug messages

Dhinakaran Pandiyan dhinakaran.pandiyan at intel.com
Fri Aug 19 22:42:03 UTC 2016


KMS has a lot of code sequences where the driver has to select a certain HW
configuration among the available ones. For e.g., link rate, clock,
voltage swing, training pattern etc. Printing such low-level messages is
valuable for debugging display problems. But, will bloat dmesg if printed
with DRM_DEBUG_KMS.

DRM_DEBUG_DISPLAY will specifically address such cases where the developer
wants communicate why a display related configuration choice was made.

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 include/drm/drmP.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index d377865..c831c69 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -114,6 +114,9 @@ struct dma_buf_attachment;
  * VBL: used for verbose debug message in the vblank code
  *	  This is the category used by the DRM_DEBUG_VBL() macro.
  *
+ * DISPLAY: used for low-level display configuration messages.
+ *	    This is the category used by the DRM_DEBUG_DISPLAY() macro.
+ *
  * Enabling verbose debug messages is done through the drm.debug parameter,
  * each category being enabled by a bit.
  *
@@ -133,6 +136,7 @@ struct dma_buf_attachment;
 #define DRM_UT_PRIME		0x08
 #define DRM_UT_ATOMIC		0x10
 #define DRM_UT_VBL		0x20
+#define DRM_UT_DISPLAY		0x40
 
 extern __printf(2, 3)
 void drm_ut_debug_printk(const char *function_name,
@@ -230,6 +234,11 @@ void drm_err(const char *format, ...);
 		if (unlikely(drm_debug & DRM_UT_VBL))			\
 			drm_ut_debug_printk(__func__, fmt, ##args);	\
 	} while (0)
+#define DRM_DEBUG_DISPLAY(fmt, args...)					\
+	do {								\
+		if (unlikely(drm_debug & DRM_UT_DISPLAY))		\
+			drm_ut_debug_printk(__func__, fmt, ##args);	\
+	} while (0)
 
 /*@}*/
 
-- 
2.5.0



More information about the dri-devel mailing list