diff options
author | Jason Ekstrand <[email protected]> | 2017-04-24 03:11:02 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-05-04 19:07:54 -0700 |
commit | bb2a3f0df8e9f92e7694c3e643c38807bfa79902 (patch) | |
tree | e0f9fea2241e78c0790a68e597827d5298777a92 /src/intel/vulkan/anv_allocator.c | |
parent | 08413a81b93dc537fb0c34327ad162f07e8c3427 (diff) |
anv/allocator: Get rid of the ability to free blocks
Now that everything is going through the state pools, the block pool no
longer needs to be able to handle re-use.
Reviewed-by: Juan A. Suarez Romero <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_allocator.c')
-rw-r--r-- | src/intel/vulkan/anv_allocator.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index b7cf1136bbd..8569f692f63 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -258,8 +258,6 @@ anv_block_pool_init(struct anv_block_pool *pool, pool->device = device; anv_bo_init(&pool->bo, 0, 0); - pool->free_list = ANV_FREE_LIST_EMPTY; - pool->back_free_list = ANV_FREE_LIST_EMPTY; pool->fd = memfd_create("block pool", MFD_CLOEXEC); if (pool->fd == -1) @@ -581,15 +579,6 @@ int32_t anv_block_pool_alloc(struct anv_block_pool *pool, uint32_t block_size) { - int32_t offset; - - /* Try free list first. */ - if (anv_free_list_pop(&pool->free_list, &pool->map, &offset)) { - assert(offset >= 0); - assert(pool->map); - return offset; - } - return anv_block_pool_alloc_new(pool, &pool->state, block_size); } @@ -606,16 +595,8 @@ int32_t anv_block_pool_alloc_back(struct anv_block_pool *pool, uint32_t block_size) { - int32_t offset; - - /* Try free list first. */ - if (anv_free_list_pop(&pool->back_free_list, &pool->map, &offset)) { - assert(offset < 0); - assert(pool->map); - return offset; - } - - offset = anv_block_pool_alloc_new(pool, &pool->back_state, block_size); + int32_t offset = anv_block_pool_alloc_new(pool, &pool->back_state, + block_size); /* The offset we get out of anv_block_pool_alloc_new() is actually the * number of bytes downwards from the middle to the end of the block. @@ -627,16 +608,6 @@ anv_block_pool_alloc_back(struct anv_block_pool *pool, } void -anv_block_pool_free(struct anv_block_pool *pool, int32_t offset) -{ - if (offset < 0) { - anv_free_list_push(&pool->back_free_list, pool->map, offset); - } else { - anv_free_list_push(&pool->free_list, pool->map, offset); - } -} - -void anv_state_pool_init(struct anv_state_pool *pool, struct anv_block_pool *block_pool, uint32_t block_size) |