Module: Mesa
Branch: master
Commit: bf97f8d467ad1d485c2327da3f4fe1f9e1dc7379
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf97f8d467ad1d485c2327da3f4fe1f9e1dc7379

Author: Ilia Mirkin <[email protected]>
Date:   Mon Oct 12 17:15:32 2015 -0400

nouveau: avoid double-emitting fence

The act of ensuring that there is space can cause a flush to happen,
which will emit the current screen fence. If that is the fence we're
trying to wait on, then it will have been emitted as a result of doing
the PUSH_SPACE. Don't attempt to emit it a second time.

Signed-off-by: Ilia Mirkin <[email protected]>
Fixes: 8053c9208f (nouveau: avoid emitting new fences unnecessarily)
Cc: [email protected]

---

 src/gallium/drivers/nouveau/nouveau_fence.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c 
b/src/gallium/drivers/nouveau/nouveau_fence.c
index 18b1592..21cf2b9 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.c
+++ b/src/gallium/drivers/nouveau/nouveau_fence.c
@@ -192,7 +192,11 @@ nouveau_fence_wait(struct nouveau_fence *fence)
 
    if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) {
       PUSH_SPACE(screen->pushbuf, 8);
-      nouveau_fence_emit(fence);
+      /* The space allocation might trigger a flush, which could emit the
+       * current fence. So check again.
+       */
+      if (fence->state < NOUVEAU_FENCE_STATE_EMITTED)
+         nouveau_fence_emit(fence);
    }
 
    if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED)

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to