mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
lavapipe: enforce monotonic timeline incrementing
maybe just being overly paranoid, but make sure that the timeline id
gets compared while the lock is held in every scenario
cc: mesa-stable
Reviewed-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15453>
(cherry picked from commit 5461a1cbaa)
This commit is contained in:
parent
5a3785ddd6
commit
26d695c5de
2 changed files with 7 additions and 4 deletions
|
|
@ -1700,7 +1700,7 @@
|
|||
"description": "lavapipe: enforce monotonic timeline incrementing",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"because_sha": null
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1622,7 +1622,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_QueueWaitIdle(
|
|||
if (queue->last_fence) {
|
||||
queue->device->pscreen->fence_finish(queue->device->pscreen, NULL, queue->last_fence, PIPE_TIMEOUT_INFINITE);
|
||||
queue->device->pscreen->fence_reference(queue->device->pscreen, &queue->device->queue.last_fence, NULL);
|
||||
queue->last_finished = timeline;
|
||||
if (timeline > queue->last_finished)
|
||||
queue->last_finished = timeline;
|
||||
}
|
||||
simple_mtx_unlock(&queue->last_lock);
|
||||
return VK_SUCCESS;
|
||||
|
|
@ -2136,7 +2137,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_GetFenceStatus(
|
|||
simple_mtx_lock(&device->queue.last_lock);
|
||||
if (fence->handle == device->queue.last_fence) {
|
||||
device->pscreen->fence_reference(device->pscreen, &device->queue.last_fence, NULL);
|
||||
device->queue.last_finished = fence->timeline;
|
||||
if (fence->timeline > device->queue.last_finished)
|
||||
device->queue.last_finished = fence->timeline;
|
||||
}
|
||||
simple_mtx_unlock(&device->queue.last_lock);
|
||||
return VK_SUCCESS;
|
||||
|
|
@ -2252,7 +2254,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_WaitForFences(
|
|||
simple_mtx_lock(&device->queue.last_lock);
|
||||
if (fence->handle == device->queue.last_fence) {
|
||||
device->pscreen->fence_reference(device->pscreen, &device->queue.last_fence, NULL);
|
||||
device->queue.last_finished = fence->timeline;
|
||||
if (fence->timeline > device->queue.last_finished)
|
||||
device->queue.last_finished = fence->timeline;
|
||||
}
|
||||
simple_mtx_unlock(&device->queue.last_lock);
|
||||
fence->signalled = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue