[Mesa-dev] [PATCH 1/2] i965: Move MI_BATCHBUFFER_END handling into brw_finish_batch().

Chris Wilson chris at chris-wilson.co.uk
Mon Sep 18 18:03:37 UTC 2017


Quoting Kenneth Graunke (2017-09-18 18:56:56)
> This is, by definition, finishing the batch.
> ---
>  src/mesa/drivers/dri/i965/intel_batchbuffer.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> index 7d5a8947e8f..dd584f533b9 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);

Tangential: Do we care about intel_upload_finish on batch flush any more
now that async access is universal?
-Chris


More information about the mesa-dev mailing list