summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i915simple/i915_debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_debug.h')
-rw-r--r--src/mesa/pipe/i915simple/i915_debug.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/mesa/pipe/i915simple/i915_debug.h b/src/mesa/pipe/i915simple/i915_debug.h
index 4c3aa64b42..13197f3595 100644
--- a/src/mesa/pipe/i915simple/i915_debug.h
+++ b/src/mesa/pipe/i915simple/i915_debug.h
@@ -31,6 +31,8 @@
#ifndef I915_DEBUG_H
#define I915_DEBUG_H
+#include <stdarg.h>
+
struct i915_context;
struct debug_stream
@@ -67,15 +69,39 @@ void i915_print_ureg(const char *msg, unsigned ureg);
#define DEBUG_SURFACE 0x2000
#define DEBUG_WINSYS 0x4000
-#ifdef DEBUG
+#if defined(DEBUG) && defined(FILE_DEBUG_FLAG)
+
#include "pipe/p_winsys.h"
-#define DBG( i915, ... ) do { \
- if ((i915)->debug & FILE_DEBUG_FLAG) \
- (i915)->pipe.winsys->printf( (i915)->pipe.winsys, __VA_ARGS__ ); \
-} while(0)
+
+static void
+I915_DBG(
+ struct i915_context *i915,
+ const char *fmt,
+ ... )
+{
+ if ((i915)->debug & FILE_DEBUG_FLAG) {
+ va_list args;
+ char buffer[256];
+
+ va_start( args, fmt );
+ vsprintf( buffer, fmt, args );
+ i915->pipe.winsys->printf( i915->pipe.winsys, buffer );
+ va_end( args );
+ }
+}
+
#else
-#define DBG( i915, ... ) \
- (void)i915
+
+static void
+I915_DBG(
+ struct i915_context *i915,
+ const char *fmt,
+ ... )
+{
+ (void) i915;
+ (void) fmt;
+}
+
#endif