With threaded_context, in the TC_TRANSFER_MAP_UNSYNC case, we are
getting called from the frontend thread, rather than driver thread.
So we need a different slab_child_pool for that.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9323>
util_primconvert_destroy(ctx->primconvert);
slab_destroy_child(&ctx->transfer_pool);
+ slab_destroy_child(&ctx->transfer_pool_unsync);
for (i = 0; i < ARRAY_SIZE(ctx->vsc_pipe_bo); i++) {
if (!ctx->vsc_pipe_bo[i])
pctx->const_uploader = pctx->stream_uploader;
slab_create_child(&ctx->transfer_pool, &screen->transfer_pool);
+ slab_create_child(&ctx->transfer_pool_unsync, &screen->transfer_pool);
fd_draw_init(pctx);
fd_resource_context_init(pctx);
/* slab for pipe_transfer allocations: */
struct slab_child_pool transfer_pool dt;
+ struct slab_child_pool transfer_pool_unsync; /* for threaded_context */
/**
* query related state:
assert(trans->b.staging == NULL); /* for threaded context only */
+ /* Don't use pool_transfers_unsync. We are always in the driver
+ * thread. Freeing an object into a different pool is allowed.
+ */
slab_free(&ctx->transfer_pool, ptrans);
}
return NULL;
}
- ptrans = slab_alloc(&ctx->transfer_pool);
+ if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC) {
+ ptrans = slab_alloc(&ctx->transfer_pool_unsync);
+ } else {
+ ptrans = slab_alloc(&ctx->transfer_pool);
+ }
+
if (!ptrans)
return NULL;