diff options
author | Marek Olšák <[email protected]> | 2016-08-28 11:05:14 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-09-06 14:24:04 +0200 |
commit | e7a73b75a0dbd599187b8980b2e1e1cb5dfdaf6d (patch) | |
tree | 4be0121e5c819988b8dbba24eebf8e6c8cdf1e55 /src/gallium/drivers/freedreno | |
parent | 761ff403024e31aacb345efaa527377894724fad (diff) |
gallium: switch drivers to the slab allocator in src/util
Diffstat (limited to 'src/gallium/drivers/freedreno')
4 files changed, 22 insertions, 22 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c index ad62fd605dd..f8604f132ad 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.c +++ b/src/gallium/drivers/freedreno/freedreno_context.c @@ -121,7 +121,7 @@ fd_context_destroy(struct pipe_context *pctx) if (ctx->primconvert) util_primconvert_destroy(ctx->primconvert); - util_slab_destroy(&ctx->transfer_pool); + slab_destroy(&ctx->transfer_pool); for (i = 0; i < ARRAY_SIZE(ctx->pipe); i++) { struct fd_vsc_pipe *pipe = &ctx->pipe[i]; @@ -265,8 +265,8 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen, ctx->batch = fd_bc_alloc_batch(&screen->batch_cache, ctx); } - util_slab_create(&ctx->transfer_pool, sizeof(struct fd_transfer), - 16, UTIL_SLAB_SINGLETHREADED); + slab_create(&ctx->transfer_pool, sizeof(struct fd_transfer), + 16); fd_draw_init(pctx); fd_resource_context_init(pctx); diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 037c199c245..e1b7b237ad3 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -33,7 +33,7 @@ #include "indices/u_primconvert.h" #include "util/u_blitter.h" #include "util/list.h" -#include "util/u_slab.h" +#include "util/slab.h" #include "util/u_string.h" #include "freedreno_batch.h" @@ -121,11 +121,11 @@ struct fd_context { struct primconvert_context *primconvert; /* slab for pipe_transfer allocations: */ - struct util_slab_mempool transfer_pool; + struct slab_mempool transfer_pool; /* slabs for fd_hw_sample and fd_hw_sample_period allocations: */ - struct util_slab_mempool sample_pool; - struct util_slab_mempool sample_period_pool; + struct slab_mempool sample_pool; + struct slab_mempool sample_period_pool; /* sample-providers for hw queries: */ const struct fd_hw_sample_provider *sample_providers[MAX_HW_SAMPLE_PROVIDERS]; diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.c b/src/gallium/drivers/freedreno/freedreno_query_hw.c index e5ef51a0b98..470826a94c8 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_hw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_hw.c @@ -108,10 +108,10 @@ resume_query(struct fd_batch *batch, struct fd_hw_query *hq, assert(idx >= 0); /* query never would have been created otherwise */ assert(!hq->period); batch->active_providers |= (1 << idx); - hq->period = util_slab_alloc(&batch->ctx->sample_period_pool); + hq->period = slab_alloc_st(&batch->ctx->sample_period_pool); list_inithead(&hq->period->list); hq->period->start = get_sample(batch, ring, hq->base.type); - /* NOTE: util_slab_alloc() does not zero out the buffer: */ + /* NOTE: slab_alloc_st() does not zero out the buffer: */ hq->period->end = NULL; } @@ -137,7 +137,7 @@ destroy_periods(struct fd_context *ctx, struct fd_hw_query *hq) fd_hw_sample_reference(ctx, &period->start, NULL); fd_hw_sample_reference(ctx, &period->end, NULL); list_del(&period->list); - util_slab_free(&ctx->sample_period_pool, period); + slab_free_st(&ctx->sample_period_pool, period); } } @@ -339,13 +339,13 @@ fd_hw_create_query(struct fd_context *ctx, unsigned query_type) struct fd_hw_sample * fd_hw_sample_init(struct fd_batch *batch, uint32_t size) { - struct fd_hw_sample *samp = util_slab_alloc(&batch->ctx->sample_pool); + struct fd_hw_sample *samp = slab_alloc_st(&batch->ctx->sample_pool); pipe_reference_init(&samp->reference, 1); samp->size = size; debug_assert(util_is_power_of_two(size)); batch->next_sample_offset = align(batch->next_sample_offset, size); samp->offset = batch->next_sample_offset; - /* NOTE: util_slab_alloc() does not zero out the buffer: */ + /* NOTE: slab_alloc_st() does not zero out the buffer: */ samp->prsc = NULL; samp->num_tiles = 0; samp->tile_stride = 0; @@ -376,7 +376,7 @@ void __fd_hw_sample_destroy(struct fd_context *ctx, struct fd_hw_sample *samp) { pipe_resource_reference(&samp->prsc, NULL); - util_slab_free(&ctx->sample_pool, samp); + slab_free_st(&ctx->sample_pool, samp); } /* called from gmem code once total storage requirements are known (ie. @@ -486,10 +486,10 @@ fd_hw_query_init(struct pipe_context *pctx) { struct fd_context *ctx = fd_context(pctx); - util_slab_create(&ctx->sample_pool, sizeof(struct fd_hw_sample), - 16, UTIL_SLAB_SINGLETHREADED); - util_slab_create(&ctx->sample_period_pool, sizeof(struct fd_hw_sample_period), - 16, UTIL_SLAB_SINGLETHREADED); + slab_create(&ctx->sample_pool, sizeof(struct fd_hw_sample), + 16); + slab_create(&ctx->sample_period_pool, sizeof(struct fd_hw_sample_period), + 16); list_inithead(&ctx->active_queries); } @@ -498,6 +498,6 @@ fd_hw_query_fini(struct pipe_context *pctx) { struct fd_context *ctx = fd_context(pctx); - util_slab_destroy(&ctx->sample_pool); - util_slab_destroy(&ctx->sample_period_pool); + slab_destroy(&ctx->sample_pool); + slab_destroy(&ctx->sample_period_pool); } diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 2a4fd7442c8..3cc6654b740 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -425,7 +425,7 @@ fd_resource_transfer_unmap(struct pipe_context *pctx, ptrans->box.x + ptrans->box.width); pipe_resource_reference(&ptrans->resource, NULL); - util_slab_free(&ctx->transfer_pool, ptrans); + slab_free_st(&ctx->transfer_pool, ptrans); free(trans->staging); } @@ -451,11 +451,11 @@ fd_resource_transfer_map(struct pipe_context *pctx, DBG("prsc=%p, level=%u, usage=%x, box=%dx%d+%d,%d", prsc, level, usage, box->width, box->height, box->x, box->y); - ptrans = util_slab_alloc(&ctx->transfer_pool); + ptrans = slab_alloc_st(&ctx->transfer_pool); if (!ptrans) return NULL; - /* util_slab_alloc() doesn't zero: */ + /* slab_alloc_st() doesn't zero: */ trans = fd_transfer(ptrans); memset(trans, 0, sizeof(*trans)); |