[Mesa-dev] [PATCH v2 07/32] radv: Implement VK_EXT_external_memory_dma_buf
Jason Ekstrand
jason at jlekstrand.net
Wed Nov 29 21:54:33 UTC 2017
On Wed, Nov 29, 2017 at 1:41 PM, Chad Versace <chadversary at chromium.org>
wrote:
> On Tue 28 Nov 2017, Jason Ekstrand wrote:
> > ---
> > src/amd/vulkan/radv_device.c | 8 ++++++--
> > src/amd/vulkan/radv_extensions.py | 1 +
> > src/amd/vulkan/radv_formats.c | 8 ++++++--
> > 3 files changed, 13 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> > index 8e5ae0b..4517227 100644
> > --- a/src/amd/vulkan/radv_device.c
> > +++ b/src/amd/vulkan/radv_device.c
> > @@ -2166,7 +2166,9 @@ VkResult radv_alloc_memory(VkDevice
> _device,
> >
> > if (import_info) {
> > assert(import_info->handleType ==
> > - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR);
> > + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR ||
> > + import_info->handleType ==
> > + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
> > mem->bo = device->ws->buffer_from_fd(device->ws,
> import_info->fd,
> > NULL, NULL);
> > if (!mem->bo) {
> > @@ -3540,7 +3542,9 @@ VkResult radv_GetMemoryFdKHR(VkDevice _device,
> >
> > /* We support only one handle type. */
>
> This comment needs updating. I suggest copy-pasting the comment from
> anvil.
>
Done.
> > assert(pGetFdInfo->handleType ==
> > - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR);
> > + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR ||
> > + pGetFdInfo->handleType ==
> > + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
> >
> > bool ret = radv_get_memory_fd(device, memory, pFD);
> > if (ret == false)
>
> Also, radv_GetMemoryFdPropertiesKHR() (the next function in this file)
> needs updating to support dma-buf. Today it unconditionally fails.
>
This was missing from anv as well. I've added it and will re-push the
branch in a minute.
For radv, I really don't know what to do here. I'm sure there are some FD
properties I should probably query and then walk a list of types and fill
out some bits. I have no idea how their memory handle interfaces work.
Dave?
--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171129/53b1a6ba/attachment.html>
More information about the mesa-dev
mailing list