diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-02-27 12:40:52 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-02-27 12:40:52 +0100 |
commit | bba601616f66bf677add72fbc60e473b184e8474 (patch) | |
tree | f927acd0f9d4a0d35fef51a4eb6b0c0a8fa08f40 | |
parent | ab8a05a88c77bcc1f0ff357dc0351f6bc9f7291a (diff) |
i915g/winsys/drm: add raw batchbuffer dumpingi915g-stuff
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 <daniel.vetter@ffwll.ch>
-rw-r--r-- | src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c | 9 | ||||
-rw-r--r-- | src/gallium/winsys/i915/drm/i915_drm_winsys.c | 1 | ||||
-rw-r--r-- | src/gallium/winsys/i915/drm/i915_drm_winsys.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c index 9211d6a83a..508103c2f8 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 <xf86drm.h> +#include <stdio.h> #define BATCH_RESERVED 16 @@ -184,6 +185,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 diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.c b/src/gallium/winsys/i915/drm/i915_drm_winsys.c index 2288b48b2b..2c3b508d05 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_winsys.c +++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.c @@ -72,6 +72,7 @@ i915_drm_winsys_create(int drmFD) drm_intel_bufmgr_gem_enable_fenced_relocs(idws->gem_manager); idws->dump_cmd = debug_get_bool_option("I915_DUMP_CMD", FALSE); + idws->dump_raw_file = debug_get_option("I915_DUMP_RAW_FILE", NULL); idws->send_cmd = !debug_get_bool_option("I915_NO_HW", FALSE); return &idws->base; diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.h b/src/gallium/winsys/i915/drm/i915_drm_winsys.h index 0d74d0270c..dae53c3e80 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_winsys.h +++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.h @@ -18,6 +18,7 @@ struct i915_drm_winsys struct i915_winsys base; boolean dump_cmd; + char *dump_raw_file; boolean send_cmd; int fd; /**< Drm file discriptor */ |