anv: further reduce pool alignments
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 23 May 2023 07:55:59 +0000 (10:55 +0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 26 May 2023 12:58:13 +0000 (12:58 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23198>

src/intel/vulkan/anv_allocator.c

index 3876f04..7de44ff 100644 (file)
@@ -355,11 +355,9 @@ 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));
-   }
+   /* Make sure VMA addresses are aligned for the block pool */
+   assert(anv_is_aligned(start_address, device->info->mem_alignment));
+   assert(anv_is_aligned(initial_size, device->info->mem_alignment));
 
    pool->name = name;
    pool->device = device;
@@ -637,9 +635,7 @@ 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);
+   uint32_t initial_size = MAX2(block_size * 16, device->info->mem_alignment);
 
    VkResult result = anv_block_pool_init(&pool->block_pool, device, name,
                                          base_address + start_offset,