Mesa (staging/22.0): Revert "lavapipe: reference gallium fences correctly."
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Feb 23 21:09:42 UTC 2022
Module: Mesa
Branch: staging/22.0
Commit: d9b63716983bbb1be6093e5f8364d0eb5d8239ef
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9b63716983bbb1be6093e5f8364d0eb5d8239ef
Author: Dylan Baker <dylan.c.baker at intel.com>
Date: Wed Feb 23 13:09:27 2022 -0800
Revert "lavapipe: reference gallium fences correctly."
This reverts commit a61cfd86e40c76b5ebcffc849450bd8a588f9a13.
---
.pick_status.json | 2 +-
src/gallium/frontends/lavapipe/lvp_device.c | 21 +++++++++------------
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index d3c2115bfbf..21d5fde0f65 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1975,7 +1975,7 @@
"description": "lavapipe: reference gallium fences correctly.",
"nominated": true,
"nomination_type": 1,
- "resolution": 1,
+ "resolution": 0,
"main_sha": null,
"because_sha": "94a4982805164f87ec5ad7cb22251315c0577d71"
},
diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index a91a85114d0..84d50bce1bd 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -1186,13 +1186,11 @@ thread_flush(struct lvp_device *device, struct lvp_fence *fence, uint64_t timeli
struct pipe_fence_handle *handle = NULL;
device->queue.ctx->flush(device->queue.ctx, &handle, 0);
if (fence)
- device->pscreen->fence_reference(device->pscreen, &fence->handle, handle);
+ fence->handle = handle;
set_last_fence(device, handle, timeline);
/* this is the array of signaling timeline semaphore links */
for (unsigned i = 0; i < num_timelines; i++)
- device->pscreen->fence_reference(device->pscreen, &timelines[i]->fence, handle);
-
- device->pscreen->fence_reference(device->pscreen, &handle, NULL);
+ timelines[i]->fence = handle;
}
/* get a new timeline link for creating a new signal event
@@ -1224,8 +1222,7 @@ get_semaphore_link(struct lvp_semaphore *sema)
* sema->lock MUST be locked before calling
*/
static void
-prune_semaphore_links(struct lvp_device *device,
- struct lvp_semaphore *sema, uint64_t timeline)
+prune_semaphore_links(struct lvp_semaphore *sema, uint64_t timeline)
{
if (!timeline)
/* zero isn't a valid id to prune with */
@@ -1240,7 +1237,7 @@ prune_semaphore_links(struct lvp_device *device,
util_dynarray_append(&sema->links, struct lvp_semaphore_timeline*, tl);
tl = tl->next;
cur->next = NULL;
- device->pscreen->fence_reference(device->pscreen, &cur->fence, NULL);
+ cur->fence = NULL;
}
/* this is now the current timeline link */
sema->timeline = tl;
@@ -1303,7 +1300,7 @@ static VkResult wait_semaphores(struct lvp_device *device,
/* no timeline link was available yet: try to find one */
simple_mtx_lock(&sema->lock);
/* always prune first to update current timeline id */
- prune_semaphore_links(device, sema, device->queue.last_finished);
+ prune_semaphore_links(sema, device->queue.last_finished);
tl_array[i].tl = find_semaphore_timeline(sema, waitval);
if (timeout && !tl_array[i].tl) {
/* still no timeline link available:
@@ -1555,7 +1552,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_QueueSubmit(
}
simple_mtx_lock(&sema->lock);
/* always prune first to make links available and update timeline id */
- prune_semaphore_links(queue->device, sema, queue->last_finished);
+ prune_semaphore_links(sema, queue->last_finished);
if (sema->current < info->pSignalSemaphoreValues[j]) {
/* only signal semaphores if the new id is >= the current one */
struct lvp_semaphore_timeline *tl = get_semaphore_link(sema);
@@ -1577,7 +1574,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_QueueSubmit(
}
simple_mtx_lock(&sema->lock);
/* always prune first to update timeline id */
- prune_semaphore_links(queue->device, sema, queue->last_finished);
+ prune_semaphore_links(sema, queue->last_finished);
if (info->pWaitSemaphoreValues[j] &&
pSubmits[i].pWaitDstStageMask && pSubmits[i].pWaitDstStageMask[j] &&
sema->current < info->pWaitSemaphoreValues[j]) {
@@ -2332,7 +2329,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_GetSemaphoreCounterValue(
LVP_FROM_HANDLE(lvp_device, device, _device);
LVP_FROM_HANDLE(lvp_semaphore, sema, _semaphore);
simple_mtx_lock(&sema->lock);
- prune_semaphore_links(device, sema, device->queue.last_finished);
+ prune_semaphore_links(sema, device->queue.last_finished);
*pValue = sema->current;
simple_mtx_unlock(&sema->lock);
return VK_SUCCESS;
@@ -2350,7 +2347,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_SignalSemaphore(
sema->current = pSignalInfo->value;
cnd_broadcast(&sema->submit);
simple_mtx_lock(&sema->lock);
- prune_semaphore_links(device, sema, device->queue.last_finished);
+ prune_semaphore_links(sema, device->queue.last_finished);
simple_mtx_unlock(&sema->lock);
return VK_SUCCESS;
}
More information about the mesa-commit
mailing list