Mesa (master): r300-gallium: Add verbosity level to debugging.

Corbin Simpson csimpson at kemper.freedesktop.org
Mon Feb 16 12:12:50 UTC 2009


Module: Mesa
Branch: master
Commit: ffbe28d25d755bc51d9f865ac176a110f6f8f5e0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffbe28d25d755bc51d9f865ac176a110f6f8f5e0

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Mon Feb 16 03:56:03 2009 -0800

r300-gallium: Add verbosity level to debugging.

Makes it a bit more manageable to read through the console logs.

---

 src/gallium/drivers/r300/r300_cs.h         |   14 +++++++++-----
 src/gallium/drivers/r300/r300_cs_inlines.h |    5 +++--
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h
index 3049702..d8038ff 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -34,6 +34,8 @@
 
 #define MAX_CS_SIZE 64 * 1024 / 4
 
+#define VERY_VERBOSE_REGISTERS 0
+
 /* XXX stolen from radeon_drm.h */
 #define RADEON_GEM_DOMAIN_CPU  0x1
 #define RADEON_GEM_DOMAIN_GTT  0x2
@@ -75,8 +77,9 @@
 } while (0)
 
 #define OUT_CS_REG(register, value) do { \
-    debug_printf("r300: writing 0x%08X to register 0x%04X\n", \
-        value, register); \
+    if (VERY_VERBOSE_REGISTERS) \
+        debug_printf("r300: writing 0x%08X to register 0x%04X\n", \
+            value, register); \
     assert(register); \
     OUT_CS(CP_PACKET0(register, 0)); \
     OUT_CS(value); \
@@ -85,8 +88,9 @@
 /* Note: This expects count to be the number of registers,
  * not the actual packet0 count! */
 #define OUT_CS_REG_SEQ(register, count) do { \
-    debug_printf("r300: writing register sequence of %d to 0x%04X\n", \
-        count, register); \
+    if (VERY_VERBOSE_REGISTERS) \
+        debug_printf("r300: writing register sequence of %d to 0x%04X\n", \
+            count, register); \
     assert(register); \
     OUT_CS(CP_PACKET0(register, ((count) - 1))); \
 } while (0)
@@ -109,7 +113,7 @@
 } while (0)
 
 #define FLUSH_CS do { \
-    debug_printf("r300: FLUSH_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \
+    debug_printf("r300: FLUSH_CS in %s (%s:%d)\n\n", __FUNCTION__, __FILE__, \
         __LINE__); \
     cs_winsys->flush_cs(cs); \
 } while (0)
diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h
index db931fd..03bb608 100644
--- a/src/gallium/drivers/r300/r300_cs_inlines.h
+++ b/src/gallium/drivers/r300/r300_cs_inlines.h
@@ -29,8 +29,9 @@
 #define RADEON_ONE_REG_WR        (1 << 15)
 
 #define OUT_CS_ONE_REG(register, count) do { \
-    debug_printf("r300: writing data sequence of %d to 0x%04X\n", \
-        count, register); \
+    if (VERY_VERBOSE_REGISTERS) \
+        debug_printf("r300: writing data sequence of %d to 0x%04X\n", \
+            count, register); \
     assert(register); \
     OUT_CS(CP_PACKET0(register, ((count) - 1)) | RADEON_ONE_REG_WR); \
 } while (0)




More information about the mesa-commit mailing list