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

@@ -73,8 +73,12 @@ VkResult anv_CreateDmaBufImageINTEL(
image = anv_image_from_handle(image_h);
uint64_t bo_flags = 0;
if (device->instance->physicalDevice.supports_48bit_addresses)
bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
result = anv_bo_cache_import(device, &device->bo_cache,
pCreateInfo->fd, &mem->bo);
pCreateInfo->fd, bo_flags, &mem->bo);
if (result != VK_SUCCESS)
goto fail_import;
@@ -90,9 +94,6 @@ VkResult anv_CreateDmaBufImageINTEL(
goto fail_import;
}
if (device->instance->physicalDevice.supports_48bit_addresses)
mem->bo->flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
image->planes[0].address = (struct anv_address) {
.bo = mem->bo,
.offset = 0,