Summary: | Mapping a DMABUF frame as a VkImage and then copying/blitting the image to another produces blank output | ||
---|---|---|---|
Product: | Mesa | Reporter: | atomnuker |
Component: | Drivers/Vulkan/intel | Assignee: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Status: | RESOLVED NOTOURBUG | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | jason |
Version: | git | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
atomnuker
2018-01-30 19:02:21 UTC
I think the problem you are running into is that VK_EXT_external_memory_dma_buf is purely a memory sharing mechanism and doesn't actually provide needed APIs for importing images. That will be covered by VK_EXT_image_drm_format_modifier which has not yet been finalized. It's definitely in-progress and we're hoping to get things nailed down very soon. In the mean time, what you're trying to do is still possible, you just have to go about it differently. Instead of creating a linear VkImage on the DMABUF, create a VkBuffer and then use vkCmdCopyBufferToImage and provide the image stride using bufferRowLength. The current Vulkan WSI code in mesa already does this internally for cross-GPU sharing via prime. (In reply to Jason Ekstrand from comment #1) > I think the problem you are running into is that > VK_EXT_external_memory_dma_buf is purely a memory sharing mechanism and > doesn't actually provide needed APIs for importing images. That will be > covered by VK_EXT_image_drm_format_modifier which has not yet been > finalized. It's definitely in-progress and we're hoping to get things > nailed down very soon. > > In the mean time, what you're trying to do is still possible, you just have > to go about it differently. Instead of creating a linear VkImage on the > DMABUF, create a VkBuffer and then use vkCmdCopyBufferToImage and provide > the image stride using bufferRowLength. The current Vulkan WSI code in mesa > already does this internally for cross-GPU sharing via prime. I see, thanks. I guess I'll wait until that extension gets finalized. Issue still occurs when copying to a VkBuffer and then to a VkImage. Closing, the format modifier API will hopefully fix this. If it doesn't will reopen. I'm looking for the code behind this report, but github doesn't have copies of this file from a year ago. The oldest is: https://github.com/atomnuker/FFmpeg/blob/b0e1c170d69be817e6ec6cabd89767217bbf4f66/libavutil/hwcontext_vulkan.c#L1186 It may help me with my own dmabuf import: https://www.reddit.com/r/vulkan/comments/ap6pa0/vkwayland_dmabuf_import_fails_with_vk_error/ |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.