[Mesa-dev] [PATCH 7/7] anv: Implement VK_KHX_external_memory_fd (v2)

Chad Versace chadversary at chromium.org
Wed Mar 1 15:34:35 UTC 2017


On Tue 28 Feb 2017, Jason Ekstrand wrote:
> On Tue, Feb 28, 2017 at 10:58 AM, Chad Versace <chadversary at chromium.org>
> wrote:
> 
> > From: Jason Ekstrand <jason.ekstrand at intel.com>
> >
> >
> > v2 (chadv):
> >   - Rebase.
> >   - Fix vkGetPhysicalDeviceImageFormatProperties2KHR when
> >     handleType == 0.
> >   - Move handleType-independency comments out of handleType-switch, in
> >     vkGetPhysicalDeviceExternalBufferPropertiesKHX.  Reduces diff in
> >     future dma_buf patches.
> >
> > Co-authored-with: Chad Versace <chadversary at chromium.org>
> > ---
> >
> > On my branch wip/anv-external-memory.
> >   http://git.kiwitree.net/cgit/~chadv/mesa/log/?h=wip/anv-external-memory
> >
> >  src/intel/vulkan/anv_device.c           | 90
> > +++++++++++++++++++++++++++++----
> >  src/intel/vulkan/anv_entrypoints_gen.py |  1 +
> >  src/intel/vulkan/anv_formats.c          | 59 ++++++++++++++++++---
> >  3 files changed, 133 insertions(+), 17 deletions(-)


> > @@ -757,8 +778,30 @@ void anv_GetPhysicalDeviceExternalBuffe
> > rPropertiesKHX(
> >      const VkPhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo,
> >      VkExternalBufferPropertiesKHX*
> >  pExternalBufferProperties)
> >  {
> > -   anv_finishme("Handle external buffers");
> > +   /* The Vulkan 1.0.42 spec says "handleType must be a valid
> > +    * VkExternalMemoryHandleTypeFlagBitsKHX value" in
> > +    * VkPhysicalDeviceExternalBufferInfoKHX. This differs from
> > +    * VkPhysicalDeviceExternalImageFormatInfoKHX, which surprisingly
> > permits
> > +    * handleType == 0.
> >
> 
> It's not that surprising.  It lets the user just always chain in the struct
> but makes it behave as if it weren't there if handleType == 0.  For this
> entrypoint, they won't be calling it unless they actually want to query
> something.

> Changes look good to me.  I'll pull this patch into my tree.

Yes, that explanation makes sense. 

Feel free to drop the "surprising" comment, or replace it with something
else.


More information about the mesa-dev mailing list