nouveau: check if a fence has already been signalled
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 10 Jul 2014 03:20:43 +0000 (23:20 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 15 Jul 2014 21:57:45 +0000 (17:57 -0400)
nouveau_fence_update does real work unconditionally. Avoid doing that if
the fence we're checking on has already been signalled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nouveau_fence.c

index c6867104adb4544084ab7bbd30d942b738dfefdf..a9448a4c721c4bb70fce0ce46ef09a05e9d12144 100644 (file)
@@ -174,6 +174,9 @@ nouveau_fence_signalled(struct nouveau_fence *fence)
 {
    struct nouveau_screen *screen = fence->screen;
 
+   if (fence->state == NOUVEAU_FENCE_STATE_SIGNALLED)
+      return TRUE;
+
    if (fence->state >= NOUVEAU_FENCE_STATE_EMITTED)
       nouveau_fence_update(screen, FALSE);