summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index 102f59dc54..febc00e921 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -3,6 +3,7 @@
#include "util/u_memory.h"
#include "i915_drm.h"
+#include "i915/i915_debug.h"
#define BATCH_RESERVED 16
@@ -151,7 +152,6 @@ i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch,
struct i915_drm_batchbuffer *batch = i915_drm_batchbuffer(ibatch);
unsigned used = 0;
int ret = 0;
- int i;
assert(i915_winsys_batchbuffer_space(ibatch) >= 0);
@@ -187,19 +187,24 @@ i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch,
/* Do the sending to HW */
ret = drm_intel_bo_exec(batch->bo, used, NULL, 0, 0);
- assert(ret == 0);
-
- if (i915_drm_winsys(ibatch->iws)->dump_cmd) {
- unsigned *ptr;
- drm_intel_bo_map(batch->bo, FALSE);
- ptr = (unsigned*)batch->bo->virtual;
- debug_printf("%s:\n", __func__);
- for (i = 0; i < used / 4; i++, ptr++) {
- debug_printf("\t%08x: %08x\n", i*4, *ptr);
- }
-
- drm_intel_bo_unmap(batch->bo);
+ if (ret != 0 || i915_drm_winsys(ibatch->iws)->dump_cmd) {
+#ifdef INTEL_MAP_BATCHBUFFER
+#ifdef INTEL_MAP_GTT
+ drm_intel_gem_bo_map_gtt(batch->bo);
+#else
+ drm_intel_bo_map(batch->bo, 0);
+#endif
+#endif
+ i915_dump_batchbuffer(ibatch);
+ assert(ret == 0);
+#ifdef INTEL_MAP_BATCHBUFFER
+#ifdef INTEL_MAP_GTT
+ drm_intel_gem_bo_unmap_gtt(batch->bo);
+#else
+ drm_intel_bo_unmap(batch->bo);
+#endif
+#endif
} else {
#ifdef INTEL_RUN_SYNC
drm_intel_bo_map(batch->bo, FALSE);