summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/i915simple/i915_debug.c19
-rw-r--r--src/gallium/drivers/i915simple/i915_debug.h4
-rw-r--r--src/gallium/drivers/i915simple/i915_debug_fp.c4
-rw-r--r--src/gallium/drivers/i915simple/i915_screen.c5
-rw-r--r--src/gallium/drivers/i965simple/brw_context.c5
-rw-r--r--src/gallium/drivers/i965simple/brw_context.h6
-rw-r--r--src/gallium/include/pipe/p_winsys.h4
-rw-r--r--src/gallium/winsys/dri/intel/intel_winsys_pipe.c10
-rw-r--r--src/gallium/winsys/xlib/xm_winsys.c11
-rw-r--r--src/gallium/winsys/xlib/xm_winsys_aub.c10
-rw-r--r--src/mesa/drivers/x11/xm_winsys.c10
11 files changed, 16 insertions, 72 deletions
diff --git a/src/gallium/drivers/i915simple/i915_debug.c b/src/gallium/drivers/i915simple/i915_debug.c
index 78102dbac2..9b9111167f 100644
--- a/src/gallium/drivers/i915simple/i915_debug.c
+++ b/src/gallium/drivers/i915simple/i915_debug.c
@@ -30,6 +30,7 @@
#include "i915_winsys.h"
#include "i915_debug.h"
#include "pipe/p_winsys.h"
+#include "pipe/p_debug.h"
static void
@@ -39,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 );
}
@@ -200,14 +199,12 @@ 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));
@@ -231,13 +228,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");
@@ -877,11 +872,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)
@@ -893,7 +888,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");
}
diff --git a/src/gallium/drivers/i915simple/i915_debug.h b/src/gallium/drivers/i915simple/i915_debug.h
index 0bcd094233..afb63edabf 100644
--- a/src/gallium/drivers/i915simple/i915_debug.h
+++ b/src/gallium/drivers/i915simple/i915_debug.h
@@ -83,11 +83,9 @@ I915_DBG(
{
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 );
+ debug_vprintf( fmt, args );
va_end( args );
}
}
diff --git a/src/gallium/drivers/i915simple/i915_debug_fp.c b/src/gallium/drivers/i915simple/i915_debug_fp.c
index ebfdb3d93c..37a3508fe1 100644
--- a/src/gallium/drivers/i915simple/i915_debug_fp.c
+++ b/src/gallium/drivers/i915simple/i915_debug_fp.c
@@ -39,11 +39,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 );
}
diff --git a/src/gallium/drivers/i915simple/i915_screen.c b/src/gallium/drivers/i915simple/i915_screen.c
index 8d7bf0b33e..839b98c0ce 100644
--- a/src/gallium/drivers/i915simple/i915_screen.c
+++ b/src/gallium/drivers/i915simple/i915_screen.c
@@ -226,9 +226,8 @@ i915_create_screen(struct pipe_winsys *winsys, uint pci_id)
break;
default:
- winsys->printf(winsys,
- "%s: unknown pci id 0x%x, cannot create screen\n",
- __FUNCTION__, pci_id);
+ debug_printf("%s: unknown pci id 0x%x, cannot create screen\n",
+ __FUNCTION__, pci_id);
return NULL;
}
diff --git a/src/gallium/drivers/i965simple/brw_context.c b/src/gallium/drivers/i965simple/brw_context.c
index 7c908da672..a276cc0535 100644
--- a/src/gallium/drivers/i965simple/brw_context.c
+++ b/src/gallium/drivers/i965simple/brw_context.c
@@ -77,9 +77,8 @@ struct pipe_context *brw_create(struct pipe_screen *screen,
{
struct brw_context *brw;
- screen->winsys->printf(screen->winsys,
- "%s: creating brw_context with pci id 0x%x\n",
- __FUNCTION__, pci_id);
+ debug_printf("%s: creating brw_context with pci id 0x%x\n",
+ __FUNCTION__, pci_id);
brw = CALLOC_STRUCT(brw_context);
if (brw == NULL)
diff --git a/src/gallium/drivers/i965simple/brw_context.h b/src/gallium/drivers/i965simple/brw_context.h
index 0c96ba1732..eeccf36785 100644
--- a/src/gallium/drivers/i965simple/brw_context.h
+++ b/src/gallium/drivers/i965simple/brw_context.h
@@ -183,12 +183,12 @@ extern int BRW_DEBUG;
#define DEBUG_MIPTREE 0x800000
#define DBG(...) do { \
- if (BRW_DEBUG & FILE_DEBUG_FLAG) \
- brw->pipe.winsys->printf(brw->pipe.winsys, __VA_ARGS__); \
+ if (BRW_DEBUG & FILE_DEBUG_FLAG) \
+ debug_printf(__VA_ARGS__); \
} while(0)
#define PRINT(...) do { \
- brw->pipe.winsys->printf(brw->pipe.winsys, __VA_ARGS__); \
+ debug_printf(brw->pipe.winsys, __VA_ARGS__); \
} while(0)
struct brw_state_flags {
diff --git a/src/gallium/include/pipe/p_winsys.h b/src/gallium/include/pipe/p_winsys.h
index 1383bd0544..8569cdcf12 100644
--- a/src/gallium/include/pipe/p_winsys.h
+++ b/src/gallium/include/pipe/p_winsys.h
@@ -73,10 +73,6 @@ struct pipe_winsys
struct pipe_surface *surf,
void *context_private );
- /** Debug output */
- void (*printf)( struct pipe_winsys *sws,
- const char *, ... );
-
/** allocate a new surface (no context dependency) */
struct pipe_surface *(*surface_alloc)(struct pipe_winsys *ws);
diff --git a/src/gallium/winsys/dri/intel/intel_winsys_pipe.c b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
index 789a386500..77dec9488d 100644
--- a/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
+++ b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
@@ -243,15 +243,6 @@ intel_i915_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
-static void
-intel_printf( struct pipe_winsys *winsys, const char *fmtString, ... )
-{
- va_list args;
- va_start( args, fmtString );
- vfprintf(stderr, fmtString, args);
- va_end( args );
-}
-
static const char *
intel_get_name( struct pipe_winsys *winsys )
{
@@ -277,7 +268,6 @@ intel_create_pipe_winsys( int fd )
iws->winsys.buffer_unmap = intel_buffer_unmap;
iws->winsys.buffer_destroy = intel_buffer_destroy;
iws->winsys.flush_frontbuffer = intel_flush_frontbuffer;
- iws->winsys.printf = intel_printf;
iws->winsys.get_name = intel_get_name;
iws->winsys.surface_alloc = intel_i915_surface_alloc;
iws->winsys.surface_alloc_storage = intel_i915_surface_alloc_storage;
diff --git a/src/gallium/winsys/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c
index 7459756279..9a20bdfb69 100644
--- a/src/gallium/winsys/xlib/xm_winsys.c
+++ b/src/gallium/winsys/xlib/xm_winsys.c
@@ -303,16 +303,6 @@ xm_flush_frontbuffer(struct pipe_winsys *pws,
-static void
-xm_printf(struct pipe_winsys *pws, const char *fmtString, ...)
-{
- va_list args;
- va_start( args, fmtString );
- vfprintf(stderr, fmtString, args);
- va_end( args );
-}
-
-
static const char *
xm_get_name(struct pipe_winsys *pws)
{
@@ -635,7 +625,6 @@ xmesa_get_pipe_winsys_aub(struct xmesa_visual *xm_vis)
ws->base.fence_finish = xm_fence_finish;
ws->base.flush_frontbuffer = xm_flush_frontbuffer;
- ws->base.printf = xm_printf;
ws->base.get_name = xm_get_name;
}
diff --git a/src/gallium/winsys/xlib/xm_winsys_aub.c b/src/gallium/winsys/xlib/xm_winsys_aub.c
index d55d8c39eb..f42f7fcc5f 100644
--- a/src/gallium/winsys/xlib/xm_winsys_aub.c
+++ b/src/gallium/winsys/xlib/xm_winsys_aub.c
@@ -311,15 +311,6 @@ aub_i915_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
-static void
-aub_printf( struct pipe_winsys *winsys, const char *fmtString, ... )
-{
- va_list args;
- va_start( args, fmtString );
- vfprintf(stderr, fmtString, args);
- va_end( args );
-}
-
static const char *
aub_get_name( struct pipe_winsys *winsys )
{
@@ -344,7 +335,6 @@ xmesa_create_pipe_winsys_aub( void )
iws->winsys.buffer_unmap = aub_buffer_unmap;
iws->winsys.buffer_destroy = aub_buffer_destroy;
iws->winsys.flush_frontbuffer = aub_flush_frontbuffer;
- iws->winsys.printf = aub_printf;
iws->winsys.get_name = aub_get_name;
iws->winsys.surface_alloc = aub_i915_surface_alloc;
diff --git a/src/mesa/drivers/x11/xm_winsys.c b/src/mesa/drivers/x11/xm_winsys.c
index 2edc697693..eab9fd3852 100644
--- a/src/mesa/drivers/x11/xm_winsys.c
+++ b/src/mesa/drivers/x11/xm_winsys.c
@@ -193,15 +193,6 @@ xm_wait_idle(struct pipe_winsys *pws)
/* no-op */
}
-static void
-xm_printf(struct pipe_winsys *pws, const char *fmtString, ...)
-{
- va_list args;
- va_start( args, fmtString );
- vfprintf(stderr, fmtString, args);
- va_end( args );
-}
-
static const char *
xm_get_name(struct pipe_winsys *pws)
{
@@ -353,7 +344,6 @@ xmesa_create_pipe_winsys( XMesaContext xmesa )
xws->winsys.flush_frontbuffer = xm_flush_frontbuffer;
xws->winsys.wait_idle = xm_wait_idle;
- xws->winsys.printf = xm_printf;
xws->winsys.get_name = xm_get_name;
xws->xmesa = xmesa;