llvmpipe: asst. clean-ups in lp_fence.c
authorBrian Paul <brianp@vmware.com>
Wed, 21 Sep 2022 17:30:11 +0000 (11:30 -0600)
committerMarge Bot <emma+marge@anholt.net>
Tue, 25 Oct 2022 15:27:12 +0000 (15:27 +0000)
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>

src/gallium/drivers/llvmpipe/lp_fence.c

index 221003d..4298cc3 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "util/timespec.h"
 
+
 /**
  * Create a new fence object.
  *
@@ -106,12 +107,14 @@ lp_fence_signal(struct lp_fence *fence)
    mtx_unlock(&fence->mutex);
 }
 
+
 boolean
 lp_fence_signalled(struct lp_fence *f)
 {
    return f->count == f->rank;
 }
 
+
 void
 lp_fence_wait(struct lp_fence *f)
 {
@@ -131,7 +134,6 @@ boolean
 lp_fence_timedwait(struct lp_fence *f, uint64_t timeout)
 {
    struct timespec ts, abs_ts;
-   int ret;
 
    timespec_get(&ts, TIME_UTC);
 
@@ -143,6 +145,7 @@ lp_fence_timedwait(struct lp_fence *f, uint64_t timeout)
    mtx_lock(&f->mutex);
    assert(f->issued);
    while (f->count < f->rank) {
+      int ret;
       if (ts_overflow)
          ret = cnd_wait(&f->signalled, &f->mutex);
       else
@@ -150,7 +153,9 @@ lp_fence_timedwait(struct lp_fence *f, uint64_t timeout)
       if (ret != thrd_success)
          break;
    }
+
    const boolean result = (f->count >= f->rank);
    mtx_unlock(&f->mutex);
+
    return result;
 }