anv/image: Implement the wsi "extension"

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
This commit is contained in:
Jason Ekstrand
2017-11-15 22:11:46 -08:00
parent a44744e01d
commit 3dabb4011f
2 changed files with 37 additions and 4 deletions

View File

@@ -1653,8 +1653,17 @@ VkResult anv_AllocateMemory(
if (pdevice->memory.heaps[mem->type->heapIndex].supports_48bit_addresses)
mem->bo->flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
if (pdevice->has_exec_async)
const struct wsi_memory_allocate_info *wsi_info =
vk_find_struct_const(pAllocateInfo->pNext, WSI_MEMORY_ALLOCATE_INFO_MESA);
if (wsi_info && wsi_info->implicit_sync) {
/* We need to set the WRITE flag on window system buffers so that GEM
* will know we're writing to them and synchronize uses on other rings
* (eg if the display server uses the blitter ring).
*/
mem->bo->flags |= EXEC_OBJECT_WRITE;
} else if (pdevice->has_exec_async) {
mem->bo->flags |= EXEC_OBJECT_ASYNC;
}
*pMem = anv_device_memory_to_handle(mem);