gallium: Eliminate p_winsys::printf

Not convenient and almost not used at all. Better replacements in p_debug.h
This commit is contained in:
José Fonseca 2008-03-31 09:02:08 +09:00
parent 63950b11b6
commit baab98a637
11 changed files with 16 additions and 72 deletions

View File

@ -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");
}

View File

@ -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 );
}
}

View File

@ -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 );
}

View File

@ -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;
}

View File

@ -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)

View File

@ -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 {

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;