From: Kenneth Graunke Date: Mon, 18 Sep 2017 17:00:48 +0000 (-0700) Subject: i965: Move MI_BATCHBUFFER_END handling into brw_finish_batch(). X-Git-Tag: upstream/18.1.0~5837 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a746021ce786cc9ad450ddfce587ae24060eec0;p=platform%2Fupstream%2Fmesa.git i965: Move MI_BATCHBUFFER_END handling into brw_finish_batch(). This is, by definition, finishing the batch. Reviewed-by: Chris Wilson --- diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 6a16771..216b027 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -665,6 +665,13 @@ brw_finish_batch(struct brw_context *brw) PIPE_CONTROL_CS_STALL); } } + + /* Mark the end of the buffer. */ + 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); + } } static void @@ -899,13 +906,6 @@ _intel_batchbuffer_flush_fence(struct brw_context *brw, brw_finish_batch(brw); - /* Mark the end of the buffer. */ - 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); - } - intel_upload_finish(brw); /* Check that we didn't just wrap our batchbuffer at a bad time. */