summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_gmem.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-11-19 10:36:19 -0500
committerRob Clark <[email protected]>2017-12-03 14:17:40 -0500
commit15ebf387fc43632be0e68365cf92ac8fb1b64a9c (patch)
treec38457eb447df994c138d01a155122406accda3c /src/gallium/drivers/freedreno/freedreno_gmem.c
parentdeb57fb237c3be9629a39ef1978dfac4563d6bda (diff)
freedreno: rework fence tracking
ctx->last_fence isn't such a terribly clever idea, if batches can be flushed out of order. Instead, each batch now holds a fence, which is created before the batch is flushed (useful for next patch), that later gets populated after the batch is actually flushed. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_gmem.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_gmem.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c
index fef76733abf..79fdb1102c3 100644
--- a/src/gallium/drivers/freedreno/freedreno_gmem.c
+++ b/src/gallium/drivers/freedreno/freedreno_gmem.c
@@ -372,15 +372,14 @@ render_sysmem(struct fd_batch *batch)
static void
flush_ring(struct fd_batch *batch)
{
- struct fd_context *ctx = batch->ctx;
+ uint32_t timestamp;
int out_fence_fd = -1;
fd_ringbuffer_flush2(batch->gmem, batch->in_fence_fd,
batch->needs_out_fence_fd ? &out_fence_fd : NULL);
- fd_fence_ref(&ctx->screen->base, &ctx->last_fence, NULL);
- ctx->last_fence = fd_fence_create(ctx,
- fd_ringbuffer_timestamp(batch->gmem), out_fence_fd);
+ timestamp = fd_ringbuffer_timestamp(batch->gmem);
+ fd_fence_populate(batch->fence, timestamp, out_fence_fd);
}
void