struct etna_context *ctx = etna_context(pctx);
struct etna_screen *screen = ctx->screen;
- mtx_lock(&screen->lock);
+ mtx_lock(&ctx->lock);
if (ctx->used_resources_read) {
/*
_mesa_set_destroy(ctx->used_resources_write, NULL);
}
- mtx_unlock(&screen->lock);
+ mtx_unlock(&ctx->lock);
if (ctx->dummy_rt)
etna_bo_del(ctx->dummy_rt);
if (ctx->in_fence_fd != -1)
close(ctx->in_fence_fd);
+ mtx_destroy(&ctx->lock);
+
FREE(pctx);
}
if (!etna_state_update(ctx))
return;
+ mtx_lock(&ctx->lock);
+
/*
* Figure out the buffers/features we need:
*/
* draw op has caused the hang. */
etna_stall(ctx->stream, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE);
}
+ mtx_unlock(&ctx->lock);
if (DBG_ENABLED(ETNA_DBG_FLUSH_ALL))
pctx->flush(pctx, NULL, 0);
struct etna_screen *screen = ctx->screen;
int out_fence_fd = -1;
- mtx_lock(&screen->lock);
+ mtx_lock(&ctx->lock);
list_for_each_entry(struct etna_hw_query, hq, &ctx->active_hw_queries, node)
etna_hw_query_suspend(hq, ctx);
}
_mesa_set_clear(ctx->used_resources_write, NULL);
- mtx_unlock(&screen->lock);
-
etna_reset_gpu_state(ctx);
+ mtx_unlock(&ctx->lock);
}
static void
if (!ctx->used_resources_write)
goto fail;
+ mtx_init(&ctx->lock, mtx_recursive);
+
/* context ctxate setup */
ctx->specs = screen->specs;
ctx->screen = screen;