[965] Convert DBG macro to use FILE_DEBUG_FLAG like i915.
authorEric Anholt <eric@anholt.net>
Mon, 19 Nov 2007 23:26:14 +0000 (15:26 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 19 Nov 2007 23:28:26 +0000 (15:28 -0800)
12 files changed:
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_fallback.c
src/mesa/drivers/dri/i965/brw_tex_layout.c
src/mesa/drivers/dri/i965/bufmgr.h
src/mesa/drivers/dri/i965/bufmgr_fake.c
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_blit.c
src/mesa/drivers/dri/i965/intel_context.c
src/mesa/drivers/dri/i965/intel_context.h
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_pixel_copy.c
src/mesa/drivers/dri/i965/intel_regions.c

index b23b357..969be59 100644 (file)
@@ -48,7 +48,7 @@
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
 
-
+#define FILE_DEBUG_FLAG DEBUG_BATCH
 
 static GLuint hw_prim[GL_POLYGON+1] = {
    _3DPRIM_POINTLIST,
index 86464b2..8c73cbb 100644 (file)
 #include "macros.h"
 #include "mtypes.h"
 
-
-
-
-
-
-
 static GLboolean do_check_fallback(struct brw_context *brw)
 {
    GLcontext *ctx = &brw->intel.ctx;
index e306c9c..d9e8896 100644 (file)
@@ -37,6 +37,8 @@
 #include "intel_tex_layout.h"
 #include "macros.h"
 
+#define FILE_DEBUG_FLAG DEBUG_MIPTREE
+
 GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
 {
    /* XXX: these vary depending on image format: 
index b31c2e6..c7051b9 100644 (file)
@@ -183,9 +183,4 @@ void bmFinishFenceLock( struct intel_context *, unsigned fence );
 
 void bm_fake_NotifyContendedLockTake( struct intel_context * );
 
-extern int INTEL_DEBUG;
-#define DEBUG_BUFMGR 0x10000000
-
-#define DBG(...)  do { if (INTEL_DEBUG & DEBUG_BUFMGR) _mesa_printf(__VA_ARGS__); } while(0)
-
 #endif
index 65760c4..4315b27 100644 (file)
@@ -50,6 +50,7 @@
 #define BM_NO_BACKING_STORE   0x2000
 #define BM_NO_FENCE_SUBDATA   0x4000
 
+#define FILE_DEBUG_FLAG DEBUG_BUFMGR
 
 static int check_fenced( struct intel_context *intel );
 
index 7a6293b..ce0d440 100644 (file)
@@ -31,6 +31,7 @@
 #include "intel_decode.h"
 #include "bufmgr.h"
 
+#define FILE_DEBUG_FLAG DEBUG_BATCH
 
 static void intel_batchbuffer_reset( struct intel_batchbuffer *batch )
 {
index 31fe20f..374022e 100644 (file)
@@ -43,8 +43,7 @@
 
 #include "bufmgr.h"
 
-
-
+#define FILE_DEBUG_FLAG DEBUG_BLIT
 
 /*
  * Copy the back buffer to the front buffer. 
index 49431b2..b825078 100644 (file)
@@ -239,6 +239,9 @@ static const struct dri_debug_control debug_control[] =
     { "wm",    DEBUG_WM },
     { "vs",    DEBUG_VS },
     { "bat",   DEBUG_BATCH },
+    { "blit",  DEBUG_BLIT},
+    { "mip",   DEBUG_MIPTREE},
+    { "reg",   DEBUG_REGION},
     { NULL,    0 }
 };
 
@@ -644,7 +647,10 @@ static void intelContendedLock( struct intel_context *intel, GLuint flags )
    /* Lost context?
     */
    if (sarea->ctxOwner != me) {
-      DBG("Lost Context: sarea->ctxOwner %x me %x\n", sarea->ctxOwner, me);
+      if (INTEL_DEBUG & DEBUG_BUFMGR) {
+        fprintf(stderr, "Lost Context: sarea->ctxOwner %x me %x\n",
+                sarea->ctxOwner, me);
+      }
       sarea->ctxOwner = me;
       intel->vtbl.lost_hardware( intel );
    }
@@ -653,7 +659,10 @@ static void intelContendedLock( struct intel_context *intel, GLuint flags )
     * between contexts which all share a local buffer manager.
     */
    if (sarea->texAge != my_bufmgr) {
-      DBG("Lost Textures: sarea->texAge %x my_bufmgr %x\n", sarea->ctxOwner, my_bufmgr);
+      if (INTEL_DEBUG & DEBUG_BUFMGR) {
+        fprintf(stderr, "Lost Textures: sarea->texAge %x my_bufmgr %x\n",
+                sarea->ctxOwner, my_bufmgr);
+      }
       sarea->texAge = my_bufmgr;
       bm_fake_NotifyContendedLockTake( intel ); 
    }
index 5848d0c..fa35f3f 100644 (file)
@@ -353,6 +353,15 @@ extern int INTEL_DEBUG;
 #define DEBUG_URB       0x20000
 #define DEBUG_VS        0x40000
 #define DEBUG_BATCH    0x80000
+#define DEBUG_BUFMGR   0x100000
+#define DEBUG_BLIT     0x200000
+#define DEBUG_REGION   0x400000
+#define DEBUG_MIPTREE  0x800000
+
+#define DBG(...) do {                                          \
+       if (INTEL_DEBUG & FILE_DEBUG_FLAG)                      \
+               _mesa_printf(__VA_ARGS__);                      \
+} while(0)
 
 /* ================================================================
  * intel_context.c:
index 268a982..09c8510 100644 (file)
@@ -32,6 +32,8 @@
 #include "enums.h"
 #include "imports.h"
 
+#define FILE_DEBUG_FLAG DEBUG_MIPTREE
+
 static GLenum target_to_target( GLenum target )
 {
    switch (target) {
index 3bdf2fb..dc2e266 100644 (file)
@@ -40,6 +40,7 @@
 #include "intel_blit.h"
 #include "intel_regions.h"
 
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
 
 static struct intel_region *
 copypix_src_region(struct intel_context *intel, GLenum type)
index b78eba8..9c92ab4 100644 (file)
@@ -45,6 +45,8 @@
 #include "bufmgr.h"
 #include "imports.h"
 
+#define FILE_DEBUG_FLAG DEBUG_REGION
+
 /* XXX: Thread safety?
  */
 GLubyte *intel_region_map(struct intel_context *intel, struct intel_region *region)