From e662bdb82084a9e8136aea1da10423786e103beb Mon Sep 17 00:00:00 2001 From: Scott D Phillips Date: Thu, 1 Mar 2018 09:25:44 -0800 Subject: anv: Soft-pin state pools The state_pools reserve virtual address space of the full BLOCK_POOL_MEMFD_SIZE, but maintain the current behavior of growing from the middle. v2: - rename block_pool::offset to block_pool::start_address (Jason) - assign state pool start_address statically (Jason) v3: - remove unnecessary bo_flags tampering for the dynamic pool (Jason) Reviewed-by: Jason Ekstrand Reviewed-by: Jordan Justen --- src/intel/vulkan/anv_private.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/intel/vulkan/anv_private.h') diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 67a12c7206e..1641aaf7a69 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -617,6 +617,12 @@ struct anv_block_pool { struct anv_bo bo; + /* The address where the start of the pool is pinned. The various bos that + * are created as the pool grows will have addresses in the range + * [start_address, start_address + BLOCK_POOL_MEMFD_SIZE). + */ + uint64_t start_address; + /* The offset from the start of the bo to the "center" of the block * pool. Pointers to allocated blocks are given by * bo.map + center_bo_offset + offsets. @@ -713,6 +719,7 @@ struct anv_state_stream { */ VkResult anv_block_pool_init(struct anv_block_pool *pool, struct anv_device *device, + uint64_t start_address, uint32_t initial_size, uint64_t bo_flags); void anv_block_pool_finish(struct anv_block_pool *pool); @@ -723,6 +730,7 @@ int32_t anv_block_pool_alloc_back(struct anv_block_pool *pool, VkResult anv_state_pool_init(struct anv_state_pool *pool, struct anv_device *device, + uint64_t start_address, uint32_t block_size, uint64_t bo_flags); void anv_state_pool_finish(struct anv_state_pool *pool); -- cgit v1.2.3