summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-07-03 13:00:50 +0100
committerJakob Bornecrantz <[email protected]>2010-07-04 13:32:02 +0100
commit34bd0569d37391569970de81dd687d2d94bc293f (patch)
tree6d799699bfad38d3e3c2bc9886f9ee353189dd23 /src/gallium/winsys
parent50f17a001fbd9ca6fd20fc43eec64abe14de7ef9 (diff)
i915g: If the kernel reject the batchbuffer print it then assert
Diffstat (limited to 'src/gallium/winsys')
-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 102f59dc541..febc00e9217 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);