summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_context.c
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-09-05 19:14:25 +0200
committerBoris Brezillon <[email protected]>2019-09-13 16:25:06 +0200
commit2fc91a16abe0e517dfb46517dc4795857f0a9343 (patch)
tree881eb9ea39390473971ec16813617a6a488da918 /src/gallium/drivers/panfrost/pan_context.c
parent835439b84fc0830447bc4c8c672c0acd237b2801 (diff)
panfrost: Move the fence creation in panfrost_flush()
panfrost_flush() is about to be reworked to flush all pending batches, but we want the fence to block on the last one. Let's move the fence creation logic in panfrost_flush() to prepare for this situation. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_context.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index de11dae0fc2..ed4bf6dca82 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1316,7 +1316,6 @@ panfrost_queue_draw(struct panfrost_context *ctx)
static void
panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate,
- struct pipe_fence_handle **fence,
struct panfrost_batch *batch)
{
panfrost_batch_submit(batch);
@@ -1324,14 +1323,14 @@ panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate,
/* If visual, we can stall a frame */
if (!flush_immediate)
- panfrost_drm_force_flush_fragment(ctx, fence);
+ panfrost_drm_force_flush_fragment(ctx);
ctx->last_fragment_flushed = false;
ctx->last_batch = batch;
/* If readback, flush now (hurts the pipelined performance) */
if (flush_immediate)
- panfrost_drm_force_flush_fragment(ctx, fence);
+ panfrost_drm_force_flush_fragment(ctx);
}
static void
@@ -1460,7 +1459,13 @@ panfrost_flush(
bool flush_immediate = /*flags & PIPE_FLUSH_END_OF_FRAME*/true;
/* Submit the frame itself */
- panfrost_submit_frame(ctx, flush_immediate, fence, batch);
+ panfrost_submit_frame(ctx, flush_immediate, batch);
+
+ if (fence) {
+ struct panfrost_fence *f = panfrost_fence_create(ctx);
+ pipe->screen->fence_reference(pipe->screen, fence, NULL);
+ *fence = (struct pipe_fence_handle *)f;
+ }
/* Prepare for the next frame */
panfrost_invalidate_frame(ctx);