summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-01-05 12:07:20 -0800
committerJuan A. Suarez Romero <[email protected]>2018-01-12 21:38:08 +0100
commit590b9b794c1fdd61a5bcb3a745e9713c22b643cf (patch)
treec296666ca8af32040e9c292dd1727e66238d9928 /src
parentb8ecf45c0d8d21341876ed542b58586702c64276 (diff)
i965: Require space for MI_BATCHBUFFER_END.
intel_batchbuffer_emit_dword doesn't reserve space for the DWord it emits. In the past, we had some reserved batch space to ensure this worked. With the switch to growing batches, we need to actually request space so that we grow if necessary. Fixes: 2c46a67b4138631217141f (i965: Delete BATCH_RESERVED handling.) Cc: [email protected] Reviewed-by: Jason Ekstrand <[email protected]> (cherry picked from commit 1c9f1a28c0738a0b1cb8626af431d18eeee3f4f1)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/intel_batchbuffer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index ba046b90d55..b58ebe17a0d 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -665,10 +665,13 @@ brw_finish_batch(struct brw_context *brw)
}
}
- /* Mark the end of the buffer. */
+ /* Emit MI_BATCH_BUFFER_END to finish our batch. Note that execbuf2
+ * requires our batch size to be QWord aligned, so we pad it out if
+ * necessary by emitting an extra MI_NOOP after the end.
+ */
+ intel_batchbuffer_require_space(brw, 8, brw->batch.ring);
intel_batchbuffer_emit_dword(&brw->batch, MI_BATCH_BUFFER_END);
if (USED_BATCH(brw->batch) & 1) {
- /* Round batchbuffer usage to 2 DWORDs. */
intel_batchbuffer_emit_dword(&brw->batch, MI_NOOP);
}