static void
etna_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
- enum pipe_flush_flags flags)
+ enum pipe_flush_flags flags, bool internal)
{
struct etna_context *ctx = etna_context(pctx);
int out_fence_fd = -1;
list_for_each_entry(struct etna_acc_query, aq, &ctx->active_acc_queries, node)
etna_acc_query_suspend(aq, ctx);
- /* flush all resources that need an implicit flush */
- set_foreach(ctx->flush_resources, entry) {
- struct pipe_resource *prsc = (struct pipe_resource *)entry->key;
+ if (!internal) {
+ /* flush all resources that need an implicit flush */
+ set_foreach(ctx->flush_resources, entry) {
+ struct pipe_resource *prsc = (struct pipe_resource *)entry->key;
- pctx->flush_resource(pctx, prsc);
- pipe_resource_reference(&prsc, NULL);
+ pctx->flush_resource(pctx, prsc);
+ pipe_resource_reference(&prsc, NULL);
+ }
+ _mesa_set_clear(ctx->flush_resources, NULL);
}
- _mesa_set_clear(ctx->flush_resources, NULL);
etna_cmd_stream_flush(ctx->stream, ctx->in_fence_fd,
(flags & PIPE_FLUSH_FENCE_FD) ? &out_fence_fd : NULL,
}
static void
+etna_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
+ enum pipe_flush_flags flags)
+{
+ etna_flush(pctx, fence, flags, false);
+}
+
+static void
etna_context_force_flush(struct etna_cmd_stream *stream, void *priv)
{
struct pipe_context *pctx = priv;
- pctx->flush(pctx, NULL, 0);
+ etna_flush(pctx, NULL, 0, true);
/* update derived states as the context is now fully dirty */
etna_state_update(etna_context(pctx));
pctx->destroy = etna_context_destroy;
pctx->draw_vbo = etna_draw_vbo;
- pctx->flush = etna_flush;
+ pctx->flush = etna_context_flush;
pctx->set_debug_callback = etna_set_debug_callback;
pctx->create_fence_fd = etna_create_fence_fd;
pctx->fence_server_sync = etna_fence_server_sync;