failover: queiten compiler warnings
[mesa.git] / src / gallium / drivers / i915simple / i915_debug.c
index 94db44e1aaf5f43370edbf2b96807694a47b9c97..7a4e7051d20d8210c3baee46114015d712989f11 100644 (file)
  * 
  **************************************************************************/
 
-//#include "imports.h"
-
 #include "i915_reg.h"
 #include "i915_context.h"
 #include "i915_winsys.h"
 #include "i915_debug.h"
 #include "pipe/p_winsys.h"
+#include "pipe/p_debug.h"
 
 
 static void
@@ -41,11 +40,9 @@ PRINTF(
                         ... )
 {
    va_list  args;
-   char     buffer[256];
 
    va_start( args, fmt );
-   vsprintf( buffer, fmt, args );
-   stream->winsys->printf( stream->winsys, buffer );
+   debug_vprintf( fmt, args );
    va_end( args );
 }
 
@@ -202,19 +199,18 @@ BITS(
                         ... )
 {
    va_list  args;
-   char     buffer[256];
    unsigned himask = ~0UL >> (31 - (hi));
 
    PRINTF(stream, "\t\t ");
 
    va_start( args, fmt );
-   vsprintf( buffer, fmt, args );
-   stream->winsys->printf( stream->winsys, buffer );
+   debug_vprintf( fmt, args );
    va_end( args );
 
    PRINTF(stream, ": 0x%x\n", ((dw) & himask) >> (lo));
 }
 
+#ifdef DEBUG
 #define MBZ( dw, hi, lo) do {                                                  \
    unsigned x = (dw) >> (lo);                          \
    unsigned lomask = (1 << (lo)) - 1;                  \
@@ -222,6 +218,10 @@ BITS(
    himask = (1UL << (hi)) - 1;                         \
    assert ((x & himask & ~lomask) == 0);       \
 } while (0)
+#else
+#define MBZ( dw, hi, lo) do {                                                  \
+} while (0)
+#endif
 
 static void
 FLAG(
@@ -233,13 +233,11 @@ FLAG(
 {
    if (((dw) >> (bit)) & 1) {
       va_list  args;
-      char     buffer[256];
 
       PRINTF(stream, "\t\t ");
 
       va_start( args, fmt );
-      vsprintf( buffer, fmt, args );
-      stream->winsys->printf( stream->winsys, buffer );
+      debug_vprintf( fmt, args );
       va_end( args );
 
       PRINTF(stream, "\n");
@@ -868,8 +866,9 @@ void
 i915_dump_batchbuffer( struct i915_context *i915 )
 {
    struct debug_stream stream;
-   unsigned *start = i915->batch_start;
-   unsigned *end = i915->winsys->batch_start( i915->winsys, 0, 0 );
+   /* TODO fix me */
+   unsigned *start = 0;/*i915->batch_start;*/
+   unsigned *end = 0;/*i915->winsys->batch_start( i915->winsys, 0, 0 );*/
    unsigned long bytes = (unsigned long) (end - start) * 4;
    boolean done = FALSE;
 
@@ -879,11 +878,11 @@ i915_dump_batchbuffer( struct i915_context *i915 )
    stream.winsys = i915->pipe.winsys;
 
    if (!start || !end) {
-      stream.winsys->printf( stream.winsys, "\n\nBATCH: ???\n");
+      debug_printf( "\n\nBATCH: ???\n");
       return;
    }
    
-   stream.winsys->printf( stream.winsys, "\n\nBATCH: (%d)\n", bytes / 4);
+   debug_printf( "\n\nBATCH: (%d)\n", bytes / 4);
 
    while (!done &&
          stream.offset < bytes)
@@ -895,7 +894,7 @@ i915_dump_batchbuffer( struct i915_context *i915 )
             stream.offset >= 0);
    }
 
-   stream.winsys->printf( stream.winsys, "END-BATCH\n\n\n");
+   debug_printf( "END-BATCH\n\n\n");
 }