gallium/radeon: use the new parent/child pools for transfers
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97894 Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
d8cff811df
commit
e56e1f8119
|
@ -283,7 +283,7 @@ static void *r600_buffer_get_transfer(struct pipe_context *ctx,
|
|||
unsigned offset)
|
||||
{
|
||||
struct r600_common_context *rctx = (struct r600_common_context*)ctx;
|
||||
struct r600_transfer *transfer = slab_alloc_st(&rctx->pool_transfers);
|
||||
struct r600_transfer *transfer = slab_alloc(&rctx->pool_transfers);
|
||||
|
||||
transfer->transfer.resource = resource;
|
||||
transfer->transfer.level = level;
|
||||
|
@ -468,7 +468,7 @@ static void r600_buffer_transfer_unmap(struct pipe_context *ctx,
|
|||
if (rtransfer->staging)
|
||||
r600_resource_reference(&rtransfer->staging, NULL);
|
||||
|
||||
slab_free_st(&rctx->pool_transfers, transfer);
|
||||
slab_free(&rctx->pool_transfers, transfer);
|
||||
}
|
||||
|
||||
void r600_buffer_subdata(struct pipe_context *ctx,
|
||||
|
|
|
@ -488,8 +488,7 @@ bool r600_common_context_init(struct r600_common_context *rctx,
|
|||
struct r600_common_screen *rscreen,
|
||||
unsigned context_flags)
|
||||
{
|
||||
slab_create(&rctx->pool_transfers,
|
||||
sizeof(struct r600_transfer), 64);
|
||||
slab_create_child(&rctx->pool_transfers, &rscreen->pool_transfers);
|
||||
|
||||
rctx->screen = rscreen;
|
||||
rctx->ws = rscreen->ws;
|
||||
|
@ -590,7 +589,7 @@ void r600_common_context_cleanup(struct r600_common_context *rctx)
|
|||
u_upload_destroy(rctx->uploader);
|
||||
}
|
||||
|
||||
slab_destroy(&rctx->pool_transfers);
|
||||
slab_destroy_child(&rctx->pool_transfers);
|
||||
|
||||
if (rctx->allocator_zeroed_memory) {
|
||||
u_suballocator_destroy(rctx->allocator_zeroed_memory);
|
||||
|
@ -1183,6 +1182,8 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
|||
rscreen->chip_class = rscreen->info.chip_class;
|
||||
rscreen->debug_flags = debug_get_flags_option("R600_DEBUG", common_debug_options, 0);
|
||||
|
||||
slab_create_parent(&rscreen->pool_transfers, sizeof(struct r600_transfer), 64);
|
||||
|
||||
rscreen->force_aniso = MIN2(16, debug_get_num_option("R600_TEX_ANISO", -1));
|
||||
if (rscreen->force_aniso >= 0) {
|
||||
printf("radeon: Forcing anisotropy filter to %ix\n",
|
||||
|
@ -1242,6 +1243,8 @@ void r600_destroy_common_screen(struct r600_common_screen *rscreen)
|
|||
pipe_mutex_destroy(rscreen->aux_context_lock);
|
||||
rscreen->aux_context->destroy(rscreen->aux_context);
|
||||
|
||||
slab_destroy_parent(&rscreen->pool_transfers);
|
||||
|
||||
rscreen->ws->destroy(rscreen->ws);
|
||||
FREE(rscreen);
|
||||
}
|
||||
|
|
|
@ -370,6 +370,8 @@ struct r600_common_screen {
|
|||
bool has_cp_dma;
|
||||
bool has_streamout;
|
||||
|
||||
struct slab_parent_pool pool_transfers;
|
||||
|
||||
/* Texture filter settings. */
|
||||
int force_aniso; /* -1 = disabled */
|
||||
|
||||
|
@ -542,7 +544,7 @@ struct r600_common_context {
|
|||
|
||||
struct u_upload_mgr *uploader;
|
||||
struct u_suballocator *allocator_zeroed_memory;
|
||||
struct slab_mempool pool_transfers;
|
||||
struct slab_child_pool pool_transfers;
|
||||
|
||||
/* Current unaccounted memory usage. */
|
||||
uint64_t vram;
|
||||
|
|
Loading…
Reference in New Issue