diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2019-08-29 14:54:12 +0300 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-11-13 12:09:16 -0800 |
commit | 14c8323774a7895ac7847990078e141d2ba7be53 (patch) | |
tree | 35e8fd53f41886609d0e5fed83ebbadddf75af11 /src | |
parent | c78901c124a7b55d2082c6429c20f36817fad786 (diff) |
anv: invalidate file descriptor of semaphore sync fd at vkQueueSubmit
We always close the in_fence at the end the anv_cmd_buffer_execbuf()
so when we take it from the semaphore, let's not forget to invalidate
it.
Note that the code leaks the fence_in if we get any error before
reaching the close(). Let's fix that in another patch or better,
rewrite the whole thing!
v2: drop redundant fd = -1 (Jason)
v3: Update commit message (Jason)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 048f0690ee4b39f865d4d6ad82a6c0290dcaaf41)
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_batch_chain.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index c5362aaebc2..cba24534a9c 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -1624,6 +1624,9 @@ anv_cmd_buffer_execbuf(struct anv_device *device, assert(!pdevice->has_syncobj); if (in_fence == -1) { in_fence = impl->fd; + if (in_fence == -1) + return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); + impl->fd = -1; } else { int merge = anv_gem_sync_file_merge(device, in_fence, impl->fd); if (merge == -1) @@ -1631,10 +1634,9 @@ anv_cmd_buffer_execbuf(struct anv_device *device, close(impl->fd); close(in_fence); + impl->fd = -1; in_fence = merge; } - - impl->fd = -1; break; case ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ: |