diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-06-12 14:09:59 +0200 |
---|---|---|
committer | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-06-22 20:04:55 +0200 |
commit | abbb1bde06990cb15c82ebcdb9ac07b00cb0ab4f (patch) | |
tree | 64ada31cfb2ed572259cea2f31fb7eadf036ffc7 /src/gallium/drivers/i915/i915_state_emit.c | |
parent | e694f3fd4865f7e85cf1d4c9fe5789fad399dbc6 (diff) | |
download | external_mesa3d-abbb1bde06990cb15c82ebcdb9ac07b00cb0ab4f.zip external_mesa3d-abbb1bde06990cb15c82ebcdb9ac07b00cb0ab4f.tar.gz external_mesa3d-abbb1bde06990cb15c82ebcdb9ac07b00cb0ab4f.tar.bz2 |
i915g: Rework debug print code
Diffstat (limited to 'src/gallium/drivers/i915/i915_state_emit.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_state_emit.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index 22082fe..bbf9ff5 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -29,6 +29,7 @@ #include "i915_reg.h" #include "i915_context.h" #include "i915_batch.h" +#include "i915_debug.h" #include "i915_reg.h" #include "i915_resource.h" @@ -111,15 +112,20 @@ i915_emit_hardware_state(struct i915_context *i915 ) 3 ) * 3/2; /* plus 50% margin */ -#if 0 - debug_printf("i915_emit_hardware_state: %d dwords, %d relocs\n", dwords, relocs); -#endif - + uintptr_t save_ptr; + size_t save_relocs; + + if (I915_DBG_ON(DBG_ATOMS)) + i915_dump_hardware_dirty(i915, __FUNCTION__); + if(!BEGIN_BATCH(dwords, relocs)) { FLUSH_BATCH(NULL); assert(BEGIN_BATCH(dwords, relocs)); } + save_ptr = (uintptr_t)i915->batch->ptr; + save_relocs = i915->batch->relocs; + /* 14 dwords, 0 relocs */ if (i915->hardware_dirty & I915_HW_INVARIENT) { @@ -399,6 +405,9 @@ i915_emit_hardware_state(struct i915_context *i915 ) OUT_BATCH(0); } + I915_DBG(DBG_EMIT, "%s: used %d dwords, %d relocs\n", __FUNCTION__, + ((uintptr_t)i915->batch->ptr - save_ptr) / 4, + i915->batch->relocs - save_relocs); i915->hardware_dirty = 0; } |