From: Kenneth Graunke Date: Sat, 10 Feb 2018 05:58:00 +0000 (-0800) Subject: iris: NOOP pad batches correctly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23367688e9cba9ed6b11e73e8af9814b200ba3f4;p=mesa.git iris: NOOP pad batches correctly --- diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index ce8b8e2ce6c..59df0ebe942 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -439,9 +439,15 @@ iris_finish_batch(struct iris_batch *batch) { batch->no_wrap = true; - /* Mark the end of the buffer. */ - const uint32_t MI_BATCH_BUFFER_END = (0xA << 23); - iris_batch_emit(batch, &MI_BATCH_BUFFER_END, sizeof(uint32_t)); + // XXX: ISP DIS + + /* 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. + */ + const uint32_t MI_BATCH_BUFFER_END_AND_NOOP[2] = { (0xA << 23), 0 }; + const bool qword_aligned = (buffer_bytes_used(&batch->cmdbuf) % 8) == 0; + iris_batch_emit(batch, MI_BATCH_BUFFER_END_AND_NOOP, qword_aligned ? 8 : 4); batch->no_wrap = false; }