lucurious icon indicating copy to clipboard operation
lucurious copied to clipboard

ENHANCEMENT: Remove VkSurfaceKHR and SwapChain Extension code

Open EasyIP2023 opened this issue 5 years ago • 2 comments

Going to create gbm_bo and handle the presentation myself.

EasyIP2023 avatar Jul 21 '20 17:07 EasyIP2023

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.

EasyIP2023 avatar Jul 27 '20 20:07 EasyIP2023

How I retrieve DMA BUF FD

  1. Create gbm_bo
  2. Retrieve number of GEM buffers with gbm_bo_get_plane_count. GEM buffers are wrapped by KMS framebuffers which contain metadata.
  3. Retrieve the GEM name (u32) with gbm_bo_get_handle_for_plane
  4. Create a prime fd from GEM name (u32) via struct drm_prime_handle prime_request and ioctl(2)
  5. Once one has a prime fd [DMA-BUF fd] extensions needed afterwards

EasyIP2023 avatar Aug 30 '20 12:08 EasyIP2023