summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_context.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-10-12 10:42:57 -0400
committerRob Clark <[email protected]>2016-12-01 20:24:59 -0500
commit534917495dca07bb63dbec49450c706fce36f176 (patch)
tree18302e519921619aba94a93c2d2579682586cf08 /src/gallium/drivers/freedreno/freedreno_context.c
parent0b98e84e9ba082b9aa00b24fded3fb56224c6fc6 (diff)
freedreno: no-op render when we need a fence
If app tries to create a fence but there is no rendering to submit, we need a dummy/no-op submit. Use a string-marker for the purpose.. mostly since it avoids needing to realize that the packet format changes in later gen's (so one less place to fixup for a5xx). Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
index 03645075bdc..1128d918b52 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -53,8 +53,17 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
fd_bc_flush(&ctx->screen->batch_cache, ctx);
}
- if (fence)
+ if (fence) {
+ /* if there hasn't been any rendering submitted yet, we might not
+ * have actually created a fence
+ */
+ if (!ctx->last_fence || ctx->batch->needs_out_fence_fd) {
+ ctx->batch->needs_flush = true;
+ fd_gmem_render_noop(ctx->batch);
+ fd_batch_reset(ctx->batch);
+ }
fd_fence_ref(pctx->screen, fence, ctx->last_fence);
+ }
}
/**