mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
nouveau: avoid leaking fences while waiting
This fixes a memory leak in some situations. Also avoids emitting an extra fence if the kick handler does the call to nouveau_fence_next itself. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
f50a45452a
commit
ce6dd69697
1 changed files with 5 additions and 6 deletions
|
|
@ -189,16 +189,15 @@ nouveau_fence_wait(struct nouveau_fence *fence)
|
|||
/* wtf, someone is waiting on a fence in flush_notify handler? */
|
||||
assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
|
||||
|
||||
if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) {
|
||||
if (fence->state < NOUVEAU_FENCE_STATE_EMITTED)
|
||||
nouveau_fence_emit(fence);
|
||||
|
||||
if (fence == screen->fence.current)
|
||||
nouveau_fence_new(screen, &screen->fence.current, FALSE);
|
||||
}
|
||||
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED) {
|
||||
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
|
||||
if (nouveau_pushbuf_kick(screen->pushbuf, screen->pushbuf->channel))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (fence == screen->fence.current)
|
||||
nouveau_fence_next(screen);
|
||||
|
||||
do {
|
||||
nouveau_fence_update(screen, FALSE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue