freedreno/drm: drop atomic refcnts
authorRob Clark <robdclark@chromium.org>
Fri, 17 Apr 2020 19:25:22 +0000 (12:25 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 30 Apr 2020 20:03:17 +0000 (20:03 +0000)
Since we dropped the async flush_queue, we no longer need the refcnts to
be atomic.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813>

src/freedreno/drm/freedreno_ringbuffer.c

index 671cbb11f688f371cf1677f85c720acc4d5e861a..d63419a745328ef7cab1ed94976795733e12a245 100644 (file)
@@ -69,7 +69,7 @@ fd_ringbuffer_new_object(struct fd_pipe *pipe, uint32_t size)
 
 void fd_ringbuffer_del(struct fd_ringbuffer *ring)
 {
-       if (!atomic_dec_and_test(&ring->refcnt))
+       if (--ring->refcnt > 0)
                return;
 
        ring->funcs->destroy(ring);
@@ -78,7 +78,7 @@ void fd_ringbuffer_del(struct fd_ringbuffer *ring)
 struct fd_ringbuffer *
 fd_ringbuffer_ref(struct fd_ringbuffer *ring)
 {
-       p_atomic_inc(&ring->refcnt);
+       ring->refcnt++;
        return ring;
 }