[Mesa-dev] [PATCH v2 12/15] i965: Make BLORP properly avoid batch wrapping.

Kenneth Graunke kenneth at whitecape.org
Thu Sep 14 16:39:37 UTC 2017


On Thursday, September 14, 2017 3:22:48 AM PDT Chris Wilson wrote:
> Quoting Kenneth Graunke (2017-09-13 21:54:14)
> > We need to set brw->no_batch_wrap to actually avoid flushing in the
> > middle of our BLORP operation, and instead grow the batchbuffer.
> > ---
> >  src/mesa/drivers/dri/i965/genX_blorp_exec.c | 16 ++--------------
> >  1 file changed, 2 insertions(+), 14 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> > index feb87923ccb..5bff7eaff59 100644
> > --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> > +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> > @@ -224,9 +224,7 @@ genX(blorp_exec)(struct blorp_batch *batch,
> >  retry:
> >     intel_batchbuffer_require_space(brw, estimated_max_batch_usage, RENDER_RING);
> >     intel_batchbuffer_save_state(brw);
> > -   struct brw_bo *saved_bo = brw->batch.bo;
> > -   uint32_t saved_used = USED_BATCH(brw->batch);
> > -   uint32_t saved_state_used = brw->batch.state_used;
> > +   brw->no_batch_wrap = true;
> >  
> >  #if GEN_GEN == 6
> >     /* Emit workaround flushes when we switch from drawing to blorping. */
> > @@ -254,17 +252,7 @@ retry:
> >  
> >     blorp_exec(batch, params);
> >  
> > -   /* Make sure we didn't wrap the batch unintentionally, and make sure we
> > -    * reserved enough space that a wrap will never happen.
> > -    */
> > -   assert(brw->batch.bo == saved_bo);
> > -   assert((USED_BATCH(brw->batch) - saved_used) * 4 +
> > -          (brw->batch.state_used - saved_state_used) <
> > -          estimated_max_batch_usage);
> > -   /* Shut up compiler warnings on release build */
> > -   (void)saved_bo;
> > -   (void)saved_used;
> > -   (void)saved_state_used;
> > +   brw->no_batch_wrap = false;
> 
> Hmm, did you add an assert(brw->no_batch_wrap) into do_flush_locked()?
> Would be good to have that assertion back now that you should have fixed
> all the early flushing...
> -Chris

The assertion was there the whole time in _intel_batchbuffer_flush_fence.
This series just prevents us from hitting it. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170914/b559abd9/attachment.sig>


More information about the mesa-dev mailing list