vc4: Move global seqno short-circuiting to vc4_wait_seqno().
authorEric Anholt <eric@anholt.net>
Wed, 7 Jan 2015 23:15:22 +0000 (15:15 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 10 Jan 2015 00:54:12 +0000 (13:54 +1300)
Any other caller would want it, too.

src/gallium/drivers/vc4/vc4_bufmgr.c
src/gallium/drivers/vc4/vc4_fence.c

index 34596be537d0b1d38a7d81551db8db210935ff8e..8c5ee64224fbacab026f76def5e5df98072da062 100644 (file)
@@ -315,6 +315,9 @@ vc4_bo_flink(struct vc4_bo *bo, uint32_t *name)
 bool
 vc4_wait_seqno(struct vc4_screen *screen, uint64_t seqno, uint64_t timeout_ns)
 {
+        if (screen->finished_seqno >= seqno)
+                return true;
+
 #ifndef USE_VC4_SIMULATOR
         struct drm_vc4_wait_seqno wait;
         memset(&wait, 0, sizeof(wait));
index 01906cdba0c438cd29a21d002151e6ece31507aa..f2ee91de61ac36a6e7a57f6e7da4ec8ed8f0ba08 100644 (file)
@@ -66,9 +66,6 @@ vc4_fence_signalled(struct pipe_screen *pscreen,
         struct vc4_screen *screen = vc4_screen(pscreen);
         struct vc4_fence *f = (struct vc4_fence *)pf;
 
-        if (screen->finished_seqno >= f->seqno)
-                return true;
-
         return vc4_wait_seqno(screen, f->seqno, 0);
 }
 
@@ -80,9 +77,6 @@ vc4_fence_finish(struct pipe_screen *pscreen,
         struct vc4_screen *screen = vc4_screen(pscreen);
         struct vc4_fence *f = (struct vc4_fence *)pf;
 
-        if (screen->finished_seqno >= f->seqno)
-                return true;
-
         return vc4_wait_seqno(screen, f->seqno, timeout_ns);
 }