diff options
author | Jason Ekstrand <[email protected]> | 2017-04-26 01:27:33 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-05-04 19:07:54 -0700 |
commit | 49ecaf88d1405ea17fc05c9b4ca066d6ebf51f62 (patch) | |
tree | dcfb54ddb511ad536196bc9df7861e2718335e2b /src/intel/vulkan/tests | |
parent | 30d63ffe2689efe111933ca60c6c6163764afd43 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/intel/vulkan/tests')
-rw-r--r-- | src/intel/vulkan/tests/block_pool_no_free.c | 7 | ||||
-rw-r--r-- | src/intel/vulkan/tests/state_pool.c | 4 | ||||
-rw-r--r-- | src/intel/vulkan/tests/state_pool_free_list_only.c | 2 | ||||
-rw-r--r-- | src/intel/vulkan/tests/state_pool_no_free.c | 4 |
4 files changed, 9 insertions, 8 deletions
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; diff --git a/src/intel/vulkan/tests/state_pool.c b/src/intel/vulkan/tests/state_pool.c index 90c9bdea514..db3f3ec08a4 100644 --- a/src/intel/vulkan/tests/state_pool.c +++ b/src/intel/vulkan/tests/state_pool.c @@ -44,8 +44,8 @@ int main(int argc, char **argv) pthread_mutex_init(&device.mutex, NULL); for (unsigned i = 0; i < NUM_RUNS; i++) { - anv_block_pool_init(&block_pool, &device, 256); - anv_state_pool_init(&state_pool, &block_pool); + anv_block_pool_init(&block_pool, &device, 4096); + anv_state_pool_init(&state_pool, &block_pool, 256); /* Grab one so a zero offset is impossible */ anv_state_pool_alloc(&state_pool, 16, 16); diff --git a/src/intel/vulkan/tests/state_pool_free_list_only.c b/src/intel/vulkan/tests/state_pool_free_list_only.c index 868815cf933..93b71efd437 100644 --- a/src/intel/vulkan/tests/state_pool_free_list_only.c +++ b/src/intel/vulkan/tests/state_pool_free_list_only.c @@ -42,7 +42,7 @@ int main(int argc, char **argv) pthread_mutex_init(&device.mutex, NULL); anv_block_pool_init(&block_pool, &device, 4096); - anv_state_pool_init(&state_pool, &block_pool); + anv_state_pool_init(&state_pool, &block_pool, 4096); /* Grab one so a zero offset is impossible */ anv_state_pool_alloc(&state_pool, 16, 16); diff --git a/src/intel/vulkan/tests/state_pool_no_free.c b/src/intel/vulkan/tests/state_pool_no_free.c index 6e012e46834..c3c7c24a0a3 100644 --- a/src/intel/vulkan/tests/state_pool_no_free.c +++ b/src/intel/vulkan/tests/state_pool_no_free.c @@ -62,8 +62,8 @@ static void run_test() struct anv_state_pool state_pool; pthread_mutex_init(&device.mutex, NULL); - anv_block_pool_init(&block_pool, &device, 64); - anv_state_pool_init(&state_pool, &block_pool); + anv_block_pool_init(&block_pool, &device, 4096); + anv_state_pool_init(&state_pool, &block_pool, 64); pthread_barrier_init(&barrier, NULL, NUM_THREADS); |