venus: close the import memory fd on success
authorYiwei Zhang <zzyiwei@chromium.org>
Sat, 17 Apr 2021 07:00:06 +0000 (07:00 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 21 Apr 2021 21:40:32 +0000 (21:40 +0000)
commit8bbe55533f536be74abfd4d1d59e5df4ad1a4ca7
tree47a44f0f1b02db432fd50397d21ff389699018e7
parent9703ca56991c0a74aeb240477a21c074ff156244
venus: close the import memory fd on success

VkImportMemoryFdInfoKHR takes fd ownership on a successful import.
Internally, vn_renderer_bo_create_dmabuf doesn't rely on the fd to
extend the life cycle of the bo or the host resource, and it won't
close the fd. Thus, we shall close the fd when the import succeeds.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10390>
src/virtio/vulkan/vn_device_memory.c