return (struct pipe_fence_handle *)fence;
}
-static void si_fence_server_sync(struct pipe_context *ctx,
- struct pipe_fence_handle *fence)
-{
- struct r600_common_context *rctx = (struct r600_common_context *)ctx;
- struct si_multi_fence *rfence = (struct si_multi_fence *)fence;
-
- util_queue_fence_wait(&rfence->ready);
-
- /* Unflushed fences from the same context are no-ops. */
- if (rfence->gfx_unflushed.ctx &&
- rfence->gfx_unflushed.ctx == rctx)
- return;
-
- /* All unflushed commands will not start execution before
- * this fence dependency is signalled.
- *
- * Should we flush the context to allow more GPU parallelism?
- */
- if (rfence->sdma)
- si_add_fence_dependency(rctx, rfence->sdma);
- if (rfence->gfx)
- si_add_fence_dependency(rctx, rfence->gfx);
-}
-
static bool si_fine_fence_signaled(struct radeon_winsys *rws,
const struct si_fine_fence *fine)
{
si_flush_from_st(ctx, NULL, PIPE_FLUSH_ASYNC);
}
+static void si_fence_server_sync(struct pipe_context *ctx,
+ struct pipe_fence_handle *fence)
+{
+ struct r600_common_context *rctx = (struct r600_common_context *)ctx;
+ struct si_multi_fence *rfence = (struct si_multi_fence *)fence;
+
+ util_queue_fence_wait(&rfence->ready);
+
+ /* Unflushed fences from the same context are no-ops. */
+ if (rfence->gfx_unflushed.ctx &&
+ rfence->gfx_unflushed.ctx == rctx)
+ return;
+
+ /* All unflushed commands will not start execution before
+ * this fence dependency is signalled.
+ *
+ * Therefore we must flush before inserting the dependency
+ */
+ si_flush_from_st(ctx, NULL, PIPE_FLUSH_ASYNC);
+
+ if (rfence->sdma)
+ si_add_fence_dependency(rctx, rfence->sdma);
+ if (rfence->gfx)
+ si_add_fence_dependency(rctx, rfence->gfx);
+}
void si_init_fence_functions(struct si_context *ctx)
{
case PIPE_CAP_TILE_RASTER_ORDER:
case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
case PIPE_CAP_CONTEXT_PRIORITY_MASK:
- case PIPE_CAP_FENCE_SIGNAL:
return 0;
+ case PIPE_CAP_FENCE_SIGNAL:
+ return sscreen->info.has_syncobj;
+
case PIPE_CAP_NATIVE_FENCE_FD:
return sscreen->info.has_fence_to_handle;