From 49ecaf88d1405ea17fc05c9b4ca066d6ebf51f62 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 26 Apr 2017 01:27:33 -0700 Subject: anv/allocator: Drop the block_size field from block_pool Since the state_stream is now pulling from a state_pool, the only thing pulling directly off the block pool is the state pool so we can just move the block_size there. The one exception is when we allocate binding tables but we can just reference the state pool there as well. The only functional change here is that we no longer grow the block pool immediately upon creation so no BO gets allocated until our first state allocation. Reviewed-by: Juan A. Suarez Romero --- src/intel/vulkan/tests/block_pool_no_free.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/intel/vulkan/tests/block_pool_no_free.c') diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c index 0a61818e42c..ac2b7801f7f 100644 --- a/src/intel/vulkan/tests/block_pool_no_free.c +++ b/src/intel/vulkan/tests/block_pool_no_free.c @@ -25,6 +25,7 @@ #include "anv_private.h" +#define BLOCK_SIZE 16 #define NUM_THREADS 16 #define BLOCKS_PER_THREAD 1024 #define NUM_RUNS 64 @@ -44,13 +45,13 @@ static void *alloc_blocks(void *_job) int32_t block, *data; for (unsigned i = 0; i < BLOCKS_PER_THREAD; i++) { - block = anv_block_pool_alloc(job->pool); + block = anv_block_pool_alloc(job->pool, BLOCK_SIZE); data = job->pool->map + block; *data = block; assert(block >= 0); job->blocks[i] = block; - block = anv_block_pool_alloc_back(job->pool); + block = anv_block_pool_alloc_back(job->pool, BLOCK_SIZE); data = job->pool->map + block; *data = block; assert(block < 0); @@ -114,7 +115,7 @@ static void run_test() struct anv_block_pool pool; pthread_mutex_init(&device.mutex, NULL); - anv_block_pool_init(&pool, &device, 16); + anv_block_pool_init(&pool, &device, 4096); for (unsigned i = 0; i < NUM_THREADS; i++) { jobs[i].pool = &pool; -- cgit v1.2.3