freedreno: use the new parent/child pools for transfers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle 2016-09-27 19:06:13 +02:00
parent 616e36674a
commit 0334ba150f
5 changed files with 12 additions and 6 deletions

View File

@ -121,7 +121,7 @@ fd_context_destroy(struct pipe_context *pctx)
if (ctx->primconvert)
util_primconvert_destroy(ctx->primconvert);
slab_destroy(&ctx->transfer_pool);
slab_destroy_child(&ctx->transfer_pool);
for (i = 0; i < ARRAY_SIZE(ctx->pipe); i++) {
struct fd_vsc_pipe *pipe = &ctx->pipe[i];
@ -265,8 +265,7 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen,
ctx->batch = fd_bc_alloc_batch(&screen->batch_cache, ctx);
}
slab_create(&ctx->transfer_pool, sizeof(struct fd_transfer),
16);
slab_create_child(&ctx->transfer_pool, &screen->transfer_pool);
fd_draw_init(pctx);
fd_resource_context_init(pctx);

View File

@ -121,7 +121,7 @@ struct fd_context {
struct primconvert_context *primconvert;
/* slab for pipe_transfer allocations: */
struct slab_mempool transfer_pool;
struct slab_child_pool transfer_pool;
/* slabs for fd_hw_sample and fd_hw_sample_period allocations: */
struct slab_mempool sample_pool;

View File

@ -425,7 +425,7 @@ fd_resource_transfer_unmap(struct pipe_context *pctx,
ptrans->box.x + ptrans->box.width);
pipe_resource_reference(&ptrans->resource, NULL);
slab_free_st(&ctx->transfer_pool, ptrans);
slab_free(&ctx->transfer_pool, ptrans);
free(trans->staging);
}
@ -451,7 +451,7 @@ 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 = slab_alloc_st(&ctx->transfer_pool);
ptrans = slab_alloc(&ctx->transfer_pool);
if (!ptrans)
return NULL;

View File

@ -138,6 +138,8 @@ fd_screen_destroy(struct pipe_screen *pscreen)
fd_bc_fini(&screen->batch_cache);
slab_destroy_parent(&screen->transfer_pool);
pipe_mutex_destroy(screen->lock);
free(screen);
@ -696,6 +698,8 @@ fd_screen_create(struct fd_device *dev)
pscreen->fence_reference = fd_screen_fence_ref;
pscreen->fence_finish = fd_screen_fence_finish;
slab_create_parent(&screen->transfer_pool, sizeof(struct fd_transfer), 16);
util_format_s3tc_init();
return pscreen;

View File

@ -34,6 +34,7 @@
#include "pipe/p_screen.h"
#include "util/u_memory.h"
#include "util/slab.h"
#include "os/os_thread.h"
#include "freedreno_batch_cache.h"
@ -55,6 +56,8 @@ struct fd_screen {
/* place for winsys to stash it's own stuff: */
void *winsys_priv;
struct slab_parent_pool transfer_pool;
uint32_t gmemsize_bytes;
uint32_t device_id;
uint32_t gpu_id; /* 220, 305, etc */