anv: Move close(fd) from anv_bo_cache_import to its callers (v2)

This will allow us to implement VK_ANDROID_native_buffer without dup'ing
the fd. We must close the fd in VK_KHR_external_memory_fd, but we should
not in VK_ANDROID_native_buffer.

v2:
  - Add missing close(fd) for case
    VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, subcase
    ANV_SEMAPHORE_TYPE_BO.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Chad Versace
2017-09-11 16:41:21 -07:00
parent 076a279a1a
commit eb69a61806
4 changed files with 24 additions and 23 deletions

View File

@@ -71,6 +71,8 @@ VkResult anv_CreateDmaBufImageINTEL(
if (result != VK_SUCCESS)
goto fail;
close(pCreateInfo->fd);
image = anv_image_from_handle(image_h);
result = anv_bo_cache_import(device, &device->bo_cache,