Mesa (main): zink: add a bind flag to indicate a resource is exported as a dmabuf
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed May 11 01:43:41 UTC 2022
Module: Mesa
Branch: main
Commit: 5513597305a2fde00ad033c184732348d08e509e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5513597305a2fde00ad033c184732348d08e509e
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Fri Apr 29 10:59:31 2022 -0400
zink: add a bind flag to indicate a resource is exported as a dmabuf
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16252>
---
src/gallium/drivers/zink/zink_resource.c | 2 ++
src/gallium/drivers/zink/zink_resource.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index a7694ce2002..0408993aaaf 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -992,6 +992,8 @@ resource_create(struct pipe_screen *pscreen,
_mesa_hash_table_init(&res->surface_cache, NULL, NULL, equals_ivci);
simple_mtx_init(&res->surface_mtx, mtx_plain);
}
+ if (res->obj->exportable)
+ res->base.b.bind |= ZINK_BIND_DMABUF;
return &res->base.b;
}
diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h
index 680bc7c3658..60a76589a4a 100644
--- a/src/gallium/drivers/zink/zink_resource.h
+++ b/src/gallium/drivers/zink/zink_resource.h
@@ -43,6 +43,7 @@ struct zink_bo;
#include <vulkan/vulkan.h>
#define ZINK_MAP_TEMPORARY (PIPE_MAP_DRV_PRV << 0)
+#define ZINK_BIND_DMABUF (1 << 29)
#define ZINK_BIND_TRANSIENT (1 << 30) //transient fb attachment
#define ZINK_BIND_VIDEO (1 << 31)
More information about the mesa-commit
mailing list