anv: garbage collect timeline semaphore when querying value
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 6 Jul 2020 14:11:35 +0000 (17:11 +0300)
committerMarge Bot <eric+marge@anholt.net>
Mon, 6 Jul 2020 22:33:46 +0000 (22:33 +0000)
If we don't garbage collect the timeline, the value never progresses
even though work completed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3226
Fixes: 34f32a6d664807 ("anv: implement VK_KHR_timeline_semaphore")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5774>

src/intel/vulkan/anv_queue.c

index 1e3801daf4a8119ad7400a34daadf48369663021..f997391bdb6cedb2df6ece0ff00eb5bce3252fd0 100644 (file)
@@ -2184,6 +2184,7 @@ VkResult anv_GetSemaphoreCounterValue(
    switch (impl->type) {
    case ANV_SEMAPHORE_TYPE_TIMELINE: {
       pthread_mutex_lock(&device->mutex);
+      anv_timeline_gc_locked(device, &impl->timeline);
       *pValue = impl->timeline.highest_past;
       pthread_mutex_unlock(&device->mutex);
       return VK_SUCCESS;