Skip to content

Fix FD ownership issue in Wayland Vulkan import

When a file descriptor is imported in Vulkan as a dma buf the Vulkan implementation takes ownership. We use this property to manage the lifetime of file descriptors allocated by WSIALLOC by importing them as VkDeviceMemory. After import the WSI Layer doesn't need to close any file descriptors and instead only needs to destroy the VkDeviceMemory object.

However after import the original file descriptor should not be used by the application. Currently the WSI Layer Wayland implementation violates this by using the FD to pass to the compositor. This commit fixes the issue by initiating the Wayland requests before importing the fd. Internally libwayland will duplicate the fd.

Change-Id: I3ca877f90f0139cf23b8b39c6024e8815b82d692 Signed-off-by: Dennis Tsiang dennis.tsiang@arm.com

Merge request reports