diff mbox

[1/2] drm: Add DRM_DEBUG_GEM

Message ID 1438090036-19235-1-git-send-email-chris@chris-wilson.co.uk
State New, archived
Headers show

Commit Message

Chris Wilson July 28, 2015, 1:27 p.m. UTC
Add a new debug value to distinguish and filter upon debug messages
emanating from GEM support code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 include/drm/drmP.h | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index f2d68d185274..e7b58e37c583 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -107,6 +107,11 @@  struct dma_buf_attachment;
  * ATOMIC: used in the atomic code.
  *	  This is the category used by the DRM_DEBUG_ATOMIC() macro.
  *
+ * GEM: used by portions of code backing the GEM interface, both in the
+ *      core (e.g. drm_gem.c) and vendor specific code.
+ *	This is the category used by the DRM_DEBUG_GEM() macro.
+ *
+ *
  * Enabling verbose debug messages is done through the drm.debug parameter,
  * each category being enabled by a bit.
  *
@@ -114,17 +119,18 @@  struct dma_buf_attachment;
  * drm.debug=0x2 will enable DRIVER messages
  * drm.debug=0x3 will enable CORE and DRIVER messages
  * ...
- * drm.debug=0xf will enable all messages
+ * drm.debug=0xff will enable all messages
  *
  * An interesting feature is that it's possible to enable verbose logging at
  * run-time by echoing the debug value in its sysfs node:
- *   # echo 0xf > /sys/module/drm/parameters/debug
+ *   # echo 0xff > /sys/module/drm/parameters/debug
  */
 #define DRM_UT_CORE 		0x01
 #define DRM_UT_DRIVER		0x02
 #define DRM_UT_KMS		0x04
 #define DRM_UT_PRIME		0x08
 #define DRM_UT_ATOMIC		0x10
+#define DRM_UT_GEM		0x20
 
 extern __printf(2, 3)
 void drm_ut_debug_printk(const char *function_name,
@@ -254,6 +260,11 @@  void drm_err(const char *format, ...);
 		if (unlikely(drm_debug & DRM_UT_ATOMIC))		\
 			drm_ut_debug_printk(__func__, fmt, ##args);	\
 	} while (0)
+#define DRM_DEBUG_GEM(fmt, args...)					\
+	do {								\
+		if (unlikely(drm_debug & DRM_UT_GEM))			\
+			drm_ut_debug_printk(__func__, fmt, ##args);	\
+	} while (0)
 
 /*@}*/