zink: add a bind flag to indicate a resource is exported as a dmabuf

Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Mike Blumenkrantz 2022-04-29 10:59:31 -04:00
parent 3d82b71516
commit c425166bc9
2 changed files with 3 additions and 0 deletions

View file

@ -987,6 +987,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;
}

View file

@ -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)