Skip to content

llvmpipe & lavalpipe: Implement sync fd import/export extensions

This implements the EGL_ANDROID_native_fence_sync in llvmpipe and then pipes that implementation into lavapipe to implement VK_KHR_external_fence_fd & VK_KHR_external_sempahore_fd extensions.

For importing we can just poll the sync fd handle, so we don't have to do anything special.

For exporting this implementations takes advantage of two quirks:

  1. llvmpipe is synchronous and the rendering is flushed when a fence is created. So the fence should already be signaled
  2. When we use the standard dmabuf API to get sync fd for a dmabuf we created with udmabuf, it will return a sync fd that is already signaled since there are no fences attached to that dmabuf.

This sync fd can then safely be passed to other systems that expect to get a legitimate sync fd handle (like compositors).

Merge request reports