anv/allocator: Set the BO flags in bo_cache_alloc/import

It's safer to set them there because we have the opportunity to properly
handle combining flags if a BO is imported more than once.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
This commit is contained in:
Jason Ekstrand
2018-05-30 15:34:25 -07:00
parent 27cc68d9e9
commit b0d50247a7
5 changed files with 60 additions and 28 deletions

View File

@@ -877,7 +877,8 @@ VkResult anv_CreateSemaphore(
} else {
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_BO;
VkResult result = anv_bo_cache_alloc(device, &device->bo_cache,
4096, &semaphore->permanent.bo);
4096, 0,
&semaphore->permanent.bo);
if (result != VK_SUCCESS) {
vk_free2(&device->alloc, pAllocator, semaphore);
return result;
@@ -1023,7 +1024,7 @@ VkResult anv_ImportSemaphoreFdKHR(
new_impl.type = ANV_SEMAPHORE_TYPE_BO;
VkResult result = anv_bo_cache_import(device, &device->bo_cache,
fd, &new_impl.bo);
fd, 0, &new_impl.bo);
if (result != VK_SUCCESS)
return result;