#define BATCH_LOCALS
#define BEGIN_BATCH( dwords, relocs ) \
- i915->winsys->batch_start( i915->winsys, dwords, relocs )
+ (i915->batch_start = i915->winsys->batch_start( i915->winsys, dwords, relocs ))
#define OUT_BATCH( dword ) \
i915->winsys->batch_dword( i915->winsys, dword )
#define ADVANCE_BATCH()
-#define FLUSH_BATCH() do { \
- if (0) i915_dump_batchbuffer( i915, i915->batch_start, BEGIN_BATCH(0, 0) ); \
- i915->winsys->batch_flush( i915->winsys ); \
- i915->batch_start = BEGIN_BATCH(0, 0); \
+#define FLUSH_BATCH() do { \
+ if (0) i915_dump_batchbuffer( i915 ); \
+ i915->winsys->batch_flush( i915->winsys ); \
+ i915->batch_start = NULL; \
i915->hardware_dirty = ~0; \
} while (0)
/* Batch stream debugging is a bit hacked up at the moment:
*/
- i915->batch_start = BEGIN_BATCH(0, 0);
+ i915->batch_start = NULL;
/*
* XXX we could plug GL selection/feedback into the drawing pipeline
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 &&