summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_allocator.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-09-11 16:41:21 -0700
committerChad Versace <[email protected]>2017-10-17 11:08:26 -0700
commiteb69a61806a6bee22f2306420314ac712f4c6e1e (patch)
treec554761aec91ebc820fd0f908b882f1ba6d202b1 /src/intel/vulkan/anv_allocator.c
parent076a279a1a0e3ffd537ff8c8e3d8541bd2d07830 (diff)
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 <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_allocator.c')
-rw-r--r--src/intel/vulkan/anv_allocator.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c
index 0f123563f79..401cea40e61 100644
--- a/src/intel/vulkan/anv_allocator.c
+++ b/src/intel/vulkan/anv_allocator.c
@@ -1324,18 +1324,6 @@ anv_bo_cache_import(struct anv_device *device,
}
pthread_mutex_unlock(&cache->mutex);
-
- /* From the Vulkan spec:
- *
- * "Importing memory from a file descriptor transfers ownership of
- * the file descriptor from the application to the Vulkan
- * implementation. The application must not perform any operations on
- * the file descriptor after a successful import."
- *
- * If the import fails, we leave the file descriptor open.
- */
- close(fd);
-
*bo_out = &bo->bo;
return VK_SUCCESS;