summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i915/i915_debug.h
diff options
context:
space:
mode:
authorJakob Bornecrantz <wallbraker@gmail.com>2010-06-12 14:09:59 +0200
committerJakob Bornecrantz <wallbraker@gmail.com>2010-06-22 20:04:55 +0200
commitabbb1bde06990cb15c82ebcdb9ac07b00cb0ab4f (patch)
tree64ada31cfb2ed572259cea2f31fb7eadf036ffc7 /src/gallium/drivers/i915/i915_debug.h
parente694f3fd4865f7e85cf1d4c9fe5789fad399dbc6 (diff)
i915g: Rework debug print code
Diffstat (limited to 'src/gallium/drivers/i915/i915_debug.h')
-rw-r--r--src/gallium/drivers/i915/i915_debug.h88
1 files changed, 25 insertions, 63 deletions
diff --git a/src/gallium/drivers/i915/i915_debug.h b/src/gallium/drivers/i915/i915_debug.h
index 67b8d9c2f6..8aa09f9c1f 100644
--- a/src/gallium/drivers/i915/i915_debug.h
+++ b/src/gallium/drivers/i915/i915_debug.h
@@ -26,89 +26,51 @@
**************************************************************************/
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
+ * Jakob Bornecrantz <wallbraker@gmail.com>
*/
#ifndef I915_DEBUG_H
#define I915_DEBUG_H
-#include <stdarg.h>
+#include "util/u_debug.h"
+struct i915_screen;
struct i915_context;
+struct i915_winsys_batchbuffer;
-struct debug_stream
-{
- unsigned offset; /* current gtt offset */
- char *ptr; /* pointer to gtt offset zero */
- char *end; /* pointer to gtt offset zero */
- unsigned print_addresses;
-};
-
-
-/* Internal functions
- */
-void i915_disassemble_program(struct debug_stream *stream,
- const unsigned *program, unsigned sz);
-
-void i915_print_ureg(const char *msg, unsigned ureg);
-
-
-#define DEBUG_BATCH 0x1
-#define DEBUG_BLIT 0x2
-#define DEBUG_BUFFER 0x4
-#define DEBUG_CONSTANTS 0x8
-#define DEBUG_CONTEXT 0x10
-#define DEBUG_DRAW 0x20
-#define DEBUG_DYNAMIC 0x40
-#define DEBUG_FLUSH 0x80
-#define DEBUG_MAP 0x100
-#define DEBUG_PROGRAM 0x200
-#define DEBUG_REGIONS 0x400
-#define DEBUG_SAMPLER 0x800
-#define DEBUG_STATIC 0x1000
-#define DEBUG_SURFACE 0x2000
-#define DEBUG_WINSYS 0x4000
-
-#include "pipe/p_compiler.h"
+#define DBG_BLIT 0x1
+#define DBG_EMIT 0x2
+#define DBG_ATOMS 0x4
+#define DBG_FLUSH 0x8
+#define DBG_TEXTURE 0x10
+#define DBG_CONSTANTS 0x20
-#if defined(DEBUG) && defined(FILE_DEBUG_FLAG)
+extern unsigned i915_debug;
-#include "util/u_simple_screen.h"
+static INLINE boolean
+I915_DBG_ON(unsigned flags)
+{
+ return i915_debug & flags;
+}
static INLINE void
-I915_DBG(
- struct i915_context *i915,
- const char *fmt,
- ... )
+I915_DBG(unsigned flags, const char *fmt, ...)
{
- if ((i915)->debug & FILE_DEBUG_FLAG) {
+ if (I915_DBG_ON(flags)) {
va_list args;
- va_start( args, fmt );
- debug_vprintf( fmt, args );
- va_end( args );
+ va_start(args, fmt);
+ debug_vprintf(fmt, args);
+ va_end(args);
}
}
-#else
-
-static INLINE void
-I915_DBG(
- struct i915_context *i915,
- const char *fmt,
- ... )
-{
- (void) i915;
- (void) fmt;
-}
-
-#endif
-
-
-struct i915_winsys_batchbuffer;
+void i915_debug_init(struct i915_screen *i915);
-void i915_dump_batchbuffer( struct i915_winsys_batchbuffer *i915 );
+void i915_dump_batchbuffer(struct i915_winsys_batchbuffer *i915);
-void i915_debug_init( struct i915_context *i915 );
+void i915_dump_dirty(struct i915_context *i915, const char *func);
+void i915_dump_hardware_dirty(struct i915_context *i915, const char *func);
#endif