diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-30 13:58:06 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-30 14:03:10 +0000 |
commit | 47916ea9d351f0ce6dc34713d6c164b0032f9830 (patch) | |
tree | f441e981e4aa4298b07c63396a3c67484ccd267b | |
parent | b118a52cd1a006321571967bd5f6c2a9e674de3a (diff) |
debug: Enable dumping of batchbuffer [compile-time only]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/i830_batchbuffer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c index 6a4ece2d..0c755d62 100644 --- a/src/i830_batchbuffer.c +++ b/src/i830_batchbuffer.c @@ -39,6 +39,8 @@ #include "i830_ring.h" #include "i915_drm.h" +#define DUMP_BATCHBUFFERS NULL /* "/tmp/i915-batchbuffers.dump" */ + static void intel_next_batch(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); @@ -153,6 +155,14 @@ void intel_batch_flush(ScrnInfoPtr scrn, Bool flush) MI_BATCH_BUFFER_END; intel->batch_used += 4; + if (DUMP_BATCHBUFFERS) { + FILE *file = fopen(DUMP_BATCHBUFFERS, "a"); + if (file) { + fwrite (intel->batch_ptr, intel->batch_used, 1, file); + fclose(file); + } + } + dri_bo_unmap(intel->batch_bo); intel->batch_ptr = NULL; |