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>
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)
close(impl->fd);
close(in_fence);
+ impl->fd = -1;
in_fence = merge;
}
-
- impl->fd = -1;
break;
case ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ: