summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-05-06 15:25:51 -0700
committerEric Anholt <eric@anholt.net>2008-05-06 15:25:51 -0700
commit42d4f89264f193e8beae7ba975df3507b81b6da0 (patch)
treebd90815482bc2850779f0f53013ab914e2be6019
parent96f52f089f42b4bca8fa5fb573c687d233851126 (diff)
GEM: Fix previous commit to avoid asserting when we run into reserved space.
These are the dwords that the reserved space is for.
-rw-r--r--src/mesa/drivers/dri/intel/intel_batchbuffer.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
index ef66fd75ac..bab8e645d4 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
@@ -206,16 +206,21 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file,
used);
/* Emit a flush if the bufmgr doesn't do it for us. */
- if (!intel->ttm)
- intel_batchbuffer_emit_dword(intel->batch, intel->vtbl.flush_cmd());
+ if (!intel->ttm) {
+ *(GLuint *) (batch->ptr) = intel->vtbl.flush_cmd();
+ batch->ptr += 4;
+ }
/* Round batchbuffer usage to 2 DWORDs. */
used = batch->ptr - batch->map;
- if ((used & 4) == 0)
- intel_batchbuffer_emit_dword(intel->batch, 0); /* noop */
+ if ((used & 4) == 0) {
+ *(GLuint *) (batch->ptr) = 0; /* noop */
+ batch->ptr += 4;
+ }
/* Mark the end of the buffer. */
- intel_batchbuffer_emit_dword(intel->batch, MI_BATCH_BUFFER_END);
+ *(GLuint *) (batch->ptr) = MI_BATCH_BUFFER_END; /* noop */
+ batch->ptr += 4;
used = batch->ptr - batch->map;