ENHANCEMENT: Remove VkSurfaceKHR and SwapChain Extension code
Going to create gbm_bo and handle the presentation myself.
The Vk_KHR_display extension isn't going to be useful.
To my knowledge I may be wrong there is no way to import gmb_bo directly into Vulkan. If the wayland display protocol is used one can create the underlying wl_buffer with gbm and import the wl_buffer into Vulkan to get desired content. But i'm not using any display server protocol.
The VK_EXT_image_drm_format_modifier extension is still needed.
Thinking I should create gbm_bo's and gather plane FD's/GEM handles to assign plane info to a VkImageDrmFormatModifierExplicitCreateInfoEXT structure. Then create a VkImage object with this structures address assigned to the pNext chain of the VkImageCreateInfo.
The VK_KHR_external_memory extension may be more useful.
How I retrieve DMA BUF FD
- Create gbm_bo
- Retrieve number of GEM buffers with
gbm_bo_get_plane_count. GEM buffers are wrapped by KMS framebuffers which contain metadata. - Retrieve the GEM name (u32) with
gbm_bo_get_handle_for_plane - Create a prime fd from GEM name (u32) via
struct drm_prime_handle prime_requestandioctl(2) - Once one has a prime fd [DMA-BUF fd] extensions needed afterwards