diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2022-02-15 10:45:37 -0800 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-02-23 20:15:24 +0000 |
commit | 0fffaa9fca93f6e9e8934b43d4aeb4594aea2202 (patch) | |
tree | 5e5d1cfbb2c7c9608223ec8b740ba02e54bb726a | |
parent | 5a28d2482f65209d376521be37e1ff0024fee4b1 (diff) |
anv: Align state pools to 2MiB on XeHP
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Fixes: c17e2216dd5 ("anv: Align buffer VMA to 2MiB for XeHP")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15054>
-rw-r--r-- | src/intel/vulkan/anv_allocator.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index a7060e347ce..821eadba3c9 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -374,6 +374,12 @@ anv_block_pool_init(struct anv_block_pool *pool, { VkResult result; + if (device->info.verx10 >= 125) { + /* Make sure VMA addresses are 2MiB aligned for the block pool */ + assert(anv_is_aligned(start_address, 2 * 1024 * 1024)); + assert(anv_is_aligned(initial_size, 2 * 1024 * 1024)); + } + pool->name = name; pool->device = device; pool->use_relocations = anv_use_relocations(device->physical); @@ -838,9 +844,13 @@ anv_state_pool_init(struct anv_state_pool *pool, /* We don't want to ever see signed overflow */ assert(start_offset < INT32_MAX - (int32_t)BLOCK_POOL_MEMFD_SIZE); + uint32_t initial_size = block_size * 16; + if (device->info.verx10 >= 125) + initial_size = MAX2(initial_size, 2 * 1024 * 1024); + VkResult result = anv_block_pool_init(&pool->block_pool, device, name, base_address + start_offset, - block_size * 16); + initial_size); if (result != VK_SUCCESS) return result; |