anv: setup BO flags at state_pool/block_pool creation

This will allow to set the flags on any anv_bo created/filled from a
state pool or block pool later.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Lionel Landwerlin
2017-11-17 17:26:59 +00:00
parent 799d350870
commit 118a8c7587
7 changed files with 41 additions and 22 deletions

View File

@@ -1211,21 +1211,31 @@ VkResult anv_CreateDevice(
}
pthread_condattr_destroy(&condattr);
anv_bo_pool_init(&device->batch_bo_pool, device);
uint64_t bo_flags =
(physical_device->supports_48bit_addresses ? EXEC_OBJECT_SUPPORTS_48B_ADDRESS : 0) |
(physical_device->has_exec_async ? EXEC_OBJECT_ASYNC : 0);
anv_bo_pool_init(&device->batch_bo_pool, device, bo_flags);
result = anv_bo_cache_init(&device->bo_cache);
if (result != VK_SUCCESS)
goto fail_batch_bo_pool;
result = anv_state_pool_init(&device->dynamic_state_pool, device, 16384);
/* For the state pools we explicitly disable 48bit. */
bo_flags = physical_device->has_exec_async ? EXEC_OBJECT_ASYNC : 0;
result = anv_state_pool_init(&device->dynamic_state_pool, device, 16384,
bo_flags);
if (result != VK_SUCCESS)
goto fail_bo_cache;
result = anv_state_pool_init(&device->instruction_state_pool, device, 16384);
result = anv_state_pool_init(&device->instruction_state_pool, device, 16384,
bo_flags);
if (result != VK_SUCCESS)
goto fail_dynamic_state_pool;
result = anv_state_pool_init(&device->surface_state_pool, device, 4096);
result = anv_state_pool_init(&device->surface_state_pool, device, 4096,
bo_flags);
if (result != VK_SUCCESS)
goto fail_instruction_state_pool;