mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 06:50:11 +01:00
nouveau/fence: rework nouveau_fence_emit so we can call it on emitted fences
Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10752>
This commit is contained in:
parent
060d055ac5
commit
54f285901d
2 changed files with 6 additions and 8 deletions
|
|
@ -60,7 +60,9 @@ nouveau_fence_emit(struct nouveau_fence *fence)
|
||||||
{
|
{
|
||||||
struct nouveau_screen *screen = fence->screen;
|
struct nouveau_screen *screen = fence->screen;
|
||||||
|
|
||||||
assert(fence->state == NOUVEAU_FENCE_STATE_AVAILABLE);
|
assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
|
||||||
|
if (fence->state >= NOUVEAU_FENCE_STATE_EMITTED)
|
||||||
|
return;
|
||||||
|
|
||||||
/* set this now, so that if fence.emit triggers a flush we don't recurse */
|
/* set this now, so that if fence.emit triggers a flush we don't recurse */
|
||||||
fence->state = NOUVEAU_FENCE_STATE_EMITTING;
|
fence->state = NOUVEAU_FENCE_STATE_EMITTING;
|
||||||
|
|
@ -190,11 +192,7 @@ nouveau_fence_kick(struct nouveau_fence *fence)
|
||||||
|
|
||||||
if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) {
|
if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) {
|
||||||
PUSH_SPACE(screen->pushbuf, 8);
|
PUSH_SPACE(screen->pushbuf, 8);
|
||||||
/* The space allocation might trigger a flush, which could emit the
|
nouveau_fence_emit(fence);
|
||||||
* current fence. So check again.
|
|
||||||
*/
|
|
||||||
if (fence->state < NOUVEAU_FENCE_STATE_EMITTED)
|
|
||||||
nouveau_fence_emit(fence);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
|
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,7 @@ nvc0_hw_get_query_result_resource(struct nvc0_context *nvc0,
|
||||||
/* If the fence guarding this query has not been emitted, that makes a lot
|
/* If the fence guarding this query has not been emitted, that makes a lot
|
||||||
* of the following logic more complicated.
|
* of the following logic more complicated.
|
||||||
*/
|
*/
|
||||||
if (hq->is64bit && hq->fence->state < NOUVEAU_FENCE_STATE_EMITTED)
|
if (hq->is64bit)
|
||||||
nouveau_fence_emit(hq->fence);
|
nouveau_fence_emit(hq->fence);
|
||||||
|
|
||||||
/* We either need to compute a 32- or 64-bit difference between 2 values,
|
/* We either need to compute a 32- or 64-bit difference between 2 values,
|
||||||
|
|
@ -642,7 +642,7 @@ nvc0_hw_query_fifo_wait(struct nvc0_context *nvc0, struct nvc0_query *q)
|
||||||
unsigned offset = hq->offset;
|
unsigned offset = hq->offset;
|
||||||
|
|
||||||
/* ensure the query's fence has been emitted */
|
/* ensure the query's fence has been emitted */
|
||||||
if (hq->is64bit && hq->fence->state < NOUVEAU_FENCE_STATE_EMITTED)
|
if (hq->is64bit)
|
||||||
nouveau_fence_emit(hq->fence);
|
nouveau_fence_emit(hq->fence);
|
||||||
|
|
||||||
PUSH_SPACE(push, 5);
|
PUSH_SPACE(push, 5);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue