zink: set dma-buf bit for shared resources

Set the dma-buf bit when supported.  This is done because
zink_resource_get_handle exports dma-bufs when WINSYS_HANDLE_TYPE_FD is
requested.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14872>
This commit is contained in:
Chia-I Wu 2022-02-03 23:55:23 -08:00 committed by Marge Bot
parent f8feaee0dd
commit 66e6e8afe6

View file

@ -503,6 +503,10 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
}
}
/* we may export WINSYS_HANDLE_TYPE_FD handle which is dma-buf */
if (shared && screen->info.have_EXT_external_memory_dma_buf)
export_types |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
/* TODO: remove linear for wsi */
bool scanout = templ->bind & PIPE_BIND_SCANOUT;