From e20c3255e29b9f94840d1f23439ab29060c94e3f Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Sun, 27 Feb 2011 16:32:38 +0100 Subject: i915g: add raw batchbuffer dumping in drm winsys These files can be decoded with intel_dump_decode from the intel-gpu-tools available at: http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/ Signed-off-by: Daniel Vetter --- src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c') diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c index afeab5eef4..54b2d7af2e 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c +++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c @@ -5,6 +5,7 @@ #include "i915_drm.h" #include "i915/i915_debug.h" #include +#include #define BATCH_RESERVED 16 @@ -169,6 +170,14 @@ i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch, assert(ret == 0); } + if (i915_drm_winsys(ibatch->iws)->dump_raw_file) { + FILE *file = fopen(i915_drm_winsys(ibatch->iws)->dump_raw_file, "a"); + if (file) { + fwrite(batch->base.map, used, 1, file); + fclose(file); + } + } + #ifdef INTEL_RUN_SYNC drm_intel_bo_wait_rendering(batch->bo); #endif -- cgit v1.2.3