mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-15 11:40:39 +01:00
freedreno/batch: Don't create fences for every batch
We only need fences for batches flushed via pctx->flush(). This will
serve as a useful signal about submits that can be merged.
v2. disable this optimization pre-a6xx until I can debug issues that
submit merging exposes
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
This commit is contained in:
parent
49852ace2a
commit
807bfa6be8
3 changed files with 17 additions and 5 deletions
|
|
@ -77,7 +77,14 @@ batch_init(struct fd_batch *batch)
|
|||
}
|
||||
|
||||
batch->in_fence_fd = -1;
|
||||
batch->fence = fd_fence_create(batch);
|
||||
batch->fence = NULL;
|
||||
|
||||
/* Work around problems on earlier gens with submit merging, etc,
|
||||
* by always creating a fence to request that the submit is flushed
|
||||
* immediately:
|
||||
*/
|
||||
if (ctx->screen->gpu_id < 600)
|
||||
batch->fence = fd_fence_create(batch);
|
||||
|
||||
batch->cleared = 0;
|
||||
batch->fast_cleared = 0;
|
||||
|
|
@ -197,7 +204,8 @@ batch_fini(struct fd_batch *batch)
|
|||
close(batch->in_fence_fd);
|
||||
|
||||
/* in case batch wasn't flushed but fence was created: */
|
||||
fd_fence_populate(batch->fence, 0, -1);
|
||||
if (batch->fence)
|
||||
fd_fence_populate(batch->fence, 0, -1);
|
||||
|
||||
fd_fence_ref(&batch->fence, NULL);
|
||||
|
||||
|
|
@ -362,7 +370,8 @@ batch_flush(struct fd_batch *batch) assert_dt
|
|||
if (batch == batch->ctx->batch)
|
||||
fd_batch_reference(&batch->ctx->batch, NULL);
|
||||
|
||||
fd_fence_ref(&batch->ctx->last_fence, batch->fence);
|
||||
if (batch->fence)
|
||||
fd_fence_ref(&batch->ctx->last_fence, batch->fence);
|
||||
|
||||
fd_gmem_render_tiles(batch);
|
||||
batch_reset_resources(batch);
|
||||
|
|
|
|||
|
|
@ -88,6 +88,8 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fencep,
|
|||
* be waiting for
|
||||
*/
|
||||
flags &= ~PIPE_FLUSH_DEFERRED;
|
||||
} else if (!batch->fence) {
|
||||
batch->fence = fd_fence_create(batch);
|
||||
}
|
||||
|
||||
/* In some sequence of events, we can end up with a last_fence that is
|
||||
|
|
|
|||
|
|
@ -662,9 +662,10 @@ flush_ring(struct fd_batch *batch)
|
|||
|
||||
fd_submit_flush(batch->submit, batch->in_fence_fd,
|
||||
batch->needs_out_fence_fd ? &out_fence_fd : NULL,
|
||||
×tamp);
|
||||
batch->fence ? ×tamp : NULL);
|
||||
|
||||
fd_fence_populate(batch->fence, timestamp, out_fence_fd);
|
||||
if (batch->fence)
|
||||
fd_fence_populate(batch->fence, timestamp, out_fence_fd);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue