Module: Mesa
Branch: main
Commit: 565bf8e45bda06fe485f2605f4108e68d065fe7a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=565bf8e45bda06fe485f2605f4108e68d065fe7a

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Apr 29 11:01:06 2022 -0400

zink: force memory exports if dmabuf bind is specified

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16252>

---

 src/gallium/drivers/zink/zink_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_resource.c 
b/src/gallium/drivers/zink/zink_resource.c
index 4f5690b3650..0c3c67870c4 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -497,7 +497,7 @@ resource_object_create(struct zink_screen *screen, const 
struct pipe_resource *t
       VK_IMAGE_ASPECT_PLANE_2_BIT,
    };
    VkExternalMemoryHandleTypeFlags external = 0;
-   bool needs_export = (templ->bind & ZINK_BIND_VIDEO) != 0;
+   bool needs_export = (templ->bind & (ZINK_BIND_VIDEO | ZINK_BIND_DMABUF)) != 
0;
    if (whandle) {
       if (whandle->type == WINSYS_HANDLE_TYPE_FD || whandle->type == 
ZINK_EXTERNAL_MEMORY_HANDLE)
          needs_export |= true;
@@ -777,7 +777,7 @@ resource_object_create(struct zink_screen *screen, const 
struct pipe_resource *t
    }
 
    VkExportMemoryAllocateInfo emai;
-   if ((templ->bind & ZINK_BIND_VIDEO) || ((templ->bind & PIPE_BIND_SHARED) && 
shared)) {
+   if ((templ->bind & ZINK_BIND_VIDEO) || ((templ->bind & PIPE_BIND_SHARED) && 
shared) || (templ->bind & ZINK_BIND_DMABUF)) {
       emai.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO;
       emai.handleTypes = export_types;
 

Reply via email to