screen->fence_reference(screen, &call->fence, fence);
}
-static uint16_t
-tc_call_fence_server_signal(struct pipe_context *pipe, void *call, uint64_t *last)
-{
- struct pipe_fence_handle *fence = to_call(call, tc_fence_call)->fence;
-
- pipe->fence_server_signal(pipe, fence);
- pipe->screen->fence_reference(pipe->screen, &fence, NULL);
- return call_size(tc_fence_call);
-}
-
static void
tc_fence_server_signal(struct pipe_context *_pipe,
struct pipe_fence_handle *fence)
{
struct threaded_context *tc = threaded_context(_pipe);
- struct pipe_screen *screen = tc->pipe->screen;
- struct tc_fence_call *call = tc_add_call(tc, TC_CALL_fence_server_signal,
- tc_fence_call);
-
- call->fence = NULL;
- screen->fence_reference(screen, &call->fence, fence);
+ struct pipe_context *pipe = tc->pipe;
+ tc_sync(tc);
+ pipe->fence_server_signal(pipe, fence);
}
static struct pipe_video_codec *
CALL(flush)
CALL(callback)
CALL(fence_server_sync)
-CALL(fence_server_signal)
CALL(destroy_query)
CALL(begin_query)
CALL(end_query)
crocus_batch_add_syncobj(&ice->batches[b], fine->syncobj,
I915_EXEC_FENCE_SIGNAL);
}
+ if (ice->batches[b].contains_fence_signal)
+ crocus_batch_flush(&ice->batches[b]);
}
}
batch->contains_fence_signal = true;
iris_batch_add_syncobj(batch, fine->syncobj, I915_EXEC_FENCE_SIGNAL);
}
+ if (batch->contains_fence_signal)
+ iris_batch_flush(batch);
}
}
si_add_syncobj_signal(sctx, sfence->gfx);
/**
- * The spec does not require a flush here. We insert a flush
+ * The spec requires a flush here. We insert a flush
* because syncobj based signals are not directly placed into
* the command stream. Instead the signal happens when the
* submission associated with the syncobj finishes execution.
struct zink_tc_fence *mfence = (struct zink_tc_fence *)pfence;
assert(!ctx->batch.state->signal_semaphore);
- /* this is a deferred flush to reduce overhead */
ctx->batch.state->signal_semaphore = mfence->sem;
ctx->batch.has_work = true;
- pctx->flush(pctx, NULL, PIPE_FLUSH_ASYNC);
+ struct zink_batch_state *bs = ctx->batch.state;
+ /* this must produce a synchronous flush that completes before the function returns */
+ pctx->flush(pctx, NULL, 0);
+ if (zink_screen(ctx->base.screen)->threaded)
+ util_queue_fence_wait(&bs->flush_completed);
}
void
pipe->flush_resource(pipe, texObj->pt);
}
- /* The driver is allowed to flush during fence_server_signal, be prepared */
+ /* The driver must flush during fence_server_signal, be prepared */
st_flush_bitmap_cache(st);
pipe->fence_server_signal(pipe, semObj->fence);
}