mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
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: 829699ba63 ("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>
This commit is contained in:
parent
cb74cd816c
commit
02f94c3306
1 changed files with 17 additions and 9 deletions
|
|
@ -306,11 +306,16 @@ VkResult anv_QueuePresentKHR(
|
||||||
/* Make sure all of the dependency semaphores have materialized when
|
/* Make sure all of the dependency semaphores have materialized when
|
||||||
* using a threaded submission.
|
* using a threaded submission.
|
||||||
*/
|
*/
|
||||||
uint32_t *syncobjs = vk_alloc(&device->vk.alloc,
|
ANV_MULTIALLOC(ma);
|
||||||
sizeof(*syncobjs) * pPresentInfo->waitSemaphoreCount, 8,
|
|
||||||
VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
|
|
||||||
|
|
||||||
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);
|
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||||
|
|
||||||
uint32_t wait_count = 0;
|
uint32_t wait_count = 0;
|
||||||
|
|
@ -323,18 +328,21 @@ VkResult anv_QueuePresentKHR(
|
||||||
if (impl->type == ANV_SEMAPHORE_TYPE_DUMMY)
|
if (impl->type == ANV_SEMAPHORE_TYPE_DUMMY)
|
||||||
continue;
|
continue;
|
||||||
assert(impl->type == ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ);
|
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;
|
int ret = 0;
|
||||||
if (wait_count > 0) {
|
if (wait_count > 0) {
|
||||||
ret =
|
ret =
|
||||||
anv_gem_syncobj_wait(device, syncobjs, wait_count,
|
anv_gem_syncobj_timeline_wait(device,
|
||||||
anv_get_absolute_timeout(INT64_MAX),
|
syncobjs, values, wait_count,
|
||||||
true /* wait_all */);
|
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)
|
if (ret)
|
||||||
return vk_error(VK_ERROR_DEVICE_LOST);
|
return vk_error(VK_ERROR_DEVICE_LOST);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue