diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2021-02-22 18:41:24 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-02-23 13:51:00 -0800 |
commit | ac1880edc595e91216d543ccdbb7490fba84cce4 (patch) | |
tree | 2ae8f918d04f9a1a4e9aeccda01c9c42c5a83357 /src | |
parent | ab3f1b8eb5174418a7ae961d8240017e9039f583 (diff) |
anv: don't wait for completion of work on vkQueuePresent()
Another mistake which is that we don't use the right wait API.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 829699ba632b2b ("anv: implement shareable timeline semaphores")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4276
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9188>
(cherry picked from commit 02f94c33066eff9e5de2077230affab1a1f3d063)
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_wsi.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index cbe5bb02914..ff1a3117cb4 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -304,11 +304,16 @@ VkResult anv_QueuePresentKHR( /* Make sure all of the dependency semaphores have materialized when * using a threaded submission. */ - uint32_t *syncobjs = vk_alloc(&device->vk.alloc, - sizeof(*syncobjs) * pPresentInfo->waitSemaphoreCount, 8, - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + ANV_MULTIALLOC(ma); - if (!syncobjs) + uint64_t *values; + uint32_t *syncobjs; + + anv_multialloc_add(&ma, &values, pPresentInfo->waitSemaphoreCount); + anv_multialloc_add(&ma, &syncobjs, pPresentInfo->waitSemaphoreCount); + + if (!anv_multialloc_alloc(&ma, &device->vk.alloc, + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND)) return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); uint32_t wait_count = 0; @@ -321,18 +326,21 @@ VkResult anv_QueuePresentKHR( if (impl->type == ANV_SEMAPHORE_TYPE_DUMMY) continue; assert(impl->type == ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ); - syncobjs[wait_count++] = impl->syncobj; + syncobjs[wait_count] = impl->syncobj; + values[wait_count] = 0; } int ret = 0; if (wait_count > 0) { ret = - anv_gem_syncobj_wait(device, syncobjs, wait_count, - anv_get_absolute_timeout(INT64_MAX), - true /* wait_all */); + anv_gem_syncobj_timeline_wait(device, + syncobjs, values, wait_count, + anv_get_absolute_timeout(INT64_MAX), + true /* wait_all */, + true /* wait_materialize */); } - vk_free(&device->vk.alloc, syncobjs); + vk_free(&device->vk.alloc, values); if (ret) return vk_error(VK_ERROR_DEVICE_LOST); |