diff options
author | Kevin Strasser <[email protected]> | 2018-04-03 14:21:34 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-04-03 18:33:17 -0700 |
commit | 5bbde9b80fe2e6a384db5d636725b8f8065bc5c5 (patch) | |
tree | 578dada38418a641ab4056707c11cd87077068bc /src/intel/vulkan | |
parent | b42633db8e3711e54a5bd10495b1436b8e362801 (diff) |
anv: Fix close(fd) before import issue in vkCreateDmaBufImageINTEL
If we close the fd before calling DRM_IOCTL_PRIME_FD_TO_HANDLE the kernel
will hit a -EBADF error. Move the close(fd) call to the end of
anv_CreateDmaBufImageINTEL().
Signed-off-by: Kevin Strasser <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_intel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_intel.c b/src/intel/vulkan/anv_intel.c index 82373f0c91d..976c83308e3 100644 --- a/src/intel/vulkan/anv_intel.c +++ b/src/intel/vulkan/anv_intel.c @@ -71,8 +71,6 @@ 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, @@ -105,6 +103,8 @@ VkResult anv_CreateDmaBufImageINTEL( *pMem = anv_device_memory_to_handle(mem); *pImage = anv_image_to_handle(image); + close(pCreateInfo->fd); + return VK_SUCCESS; fail_import: |