From 7a7899a2476592e846b908a557a738a49fa9a948 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 3 Nov 2007 02:00:28 +0000 Subject: Allow batch buffer debugging without calling i915_winsys->batch_start so often. --- src/mesa/pipe/i915simple/i915_debug.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/mesa/pipe/i915simple/i915_debug.c') diff --git a/src/mesa/pipe/i915simple/i915_debug.c b/src/mesa/pipe/i915simple/i915_debug.c index d142194d84..d07d2f1fa9 100644 --- a/src/mesa/pipe/i915simple/i915_debug.c +++ b/src/mesa/pipe/i915simple/i915_debug.c @@ -822,20 +822,24 @@ static boolean i915_debug_packet( struct debug_stream *stream ) void -i915_dump_batchbuffer( struct i915_context *i915, - unsigned *start, - unsigned *end ) +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 ); unsigned bytes = (end - start) * 4; boolean done = FALSE; - stream.offset = 0; stream.ptr = (char *)start; stream.print_addresses = 0; stream.winsys = i915->pipe.winsys; + if (!start || !end) { + stream.winsys->printf( stream.winsys, "\n\nBATCH: ???\n"); + return; + } + stream.winsys->printf( stream.winsys, "\n\nBATCH: (%d)\n", bytes / 4); while (!done && -- cgit v1.2.3