From e56e1f8119f28eebbe6fbe7040c80a6dd884f5fd Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Tue, 27 Sep 2016 18:53:45 +0200 Subject: gallium/radeon: use the new parent/child pools for transfers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97894 Reviewed-by: Marek Olšák --- src/gallium/drivers/radeon/r600_buffer_common.c | 4 ++-- src/gallium/drivers/radeon/r600_pipe_common.c | 9 ++++++--- src/gallium/drivers/radeon/r600_pipe_common.h | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c index 228674a02ad..74bec262603 100644 --- a/src/gallium/drivers/radeon/r600_buffer_common.c +++ b/src/gallium/drivers/radeon/r600_buffer_common.c @@ -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, diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 9e03aaa771b..3a5a854a9aa 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -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); } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 6d03db6e1c7..4ee7daaa38c 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -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; -- cgit v1.2.3