From 27674c41352dc78ad79f67cebca16d7896cd2093 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Nov 2007 15:26:14 -0800 Subject: [965] Convert DBG macro to use FILE_DEBUG_FLAG like i915. --- src/mesa/drivers/dri/i965/brw_draw.c | 2 +- src/mesa/drivers/dri/i965/brw_fallback.c | 6 ------ src/mesa/drivers/dri/i965/brw_tex_layout.c | 2 ++ src/mesa/drivers/dri/i965/bufmgr.h | 5 ----- src/mesa/drivers/dri/i965/bufmgr_fake.c | 1 + src/mesa/drivers/dri/i965/intel_batchbuffer.c | 1 + src/mesa/drivers/dri/i965/intel_blit.c | 3 +-- src/mesa/drivers/dri/i965/intel_context.c | 13 +++++++++++-- src/mesa/drivers/dri/i965/intel_context.h | 9 +++++++++ src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 ++ src/mesa/drivers/dri/i965/intel_pixel_copy.c | 1 + src/mesa/drivers/dri/i965/intel_regions.c | 2 ++ 12 files changed, 31 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index b23b357..969be59 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -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, diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 86464b2..8c73cbb 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -39,12 +39,6 @@ #include "macros.h" #include "mtypes.h" - - - - - - static GLboolean do_check_fallback(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index e306c9c..d9e8896 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -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: diff --git a/src/mesa/drivers/dri/i965/bufmgr.h b/src/mesa/drivers/dri/i965/bufmgr.h index b31c2e6..c7051b9 100644 --- a/src/mesa/drivers/dri/i965/bufmgr.h +++ b/src/mesa/drivers/dri/i965/bufmgr.h @@ -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 diff --git a/src/mesa/drivers/dri/i965/bufmgr_fake.c b/src/mesa/drivers/dri/i965/bufmgr_fake.c index 65760c4..4315b27 100644 --- a/src/mesa/drivers/dri/i965/bufmgr_fake.c +++ b/src/mesa/drivers/dri/i965/bufmgr_fake.c @@ -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 ); diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 7a6293b..ce0d440 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -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 ) { diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c index 31fe20f..374022e 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.c +++ b/src/mesa/drivers/dri/i965/intel_blit.c @@ -43,8 +43,7 @@ #include "bufmgr.h" - - +#define FILE_DEBUG_FLAG DEBUG_BLIT /* * Copy the back buffer to the front buffer. diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c index 49431b2..b825078 100644 --- a/src/mesa/drivers/dri/i965/intel_context.c +++ b/src/mesa/drivers/dri/i965/intel_context.c @@ -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 ); } diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h index 5848d0c..fa35f3f 100644 --- a/src/mesa/drivers/dri/i965/intel_context.h +++ b/src/mesa/drivers/dri/i965/intel_context.h @@ -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: diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 268a982..09c8510 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -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) { diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c index 3bdf2fb..dc2e266 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c @@ -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) diff --git a/src/mesa/drivers/dri/i965/intel_regions.c b/src/mesa/drivers/dri/i965/intel_regions.c index b78eba8..9c92ab4 100644 --- a/src/mesa/drivers/dri/i965/intel_regions.c +++ b/src/mesa/drivers/dri/i965/intel_regions.c @@ -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) -- cgit v1.1