Mesa (master): freedreno/drm: drop atomic refcnts

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 30 20:21:11 UTC 2020


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Fri Apr 17 12:25:22 2020 -0700

freedreno/drm: drop atomic refcnts

Since we dropped the async flush_queue, we no longer need the refcnts to
be atomic.

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

---

 src/freedreno/drm/freedreno_ringbuffer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/freedreno/drm/freedreno_ringbuffer.c b/src/freedreno/drm/freedreno_ringbuffer.c
index 671cbb11f68..d63419a7453 100644
--- a/src/freedreno/drm/freedreno_ringbuffer.c
+++ b/src/freedreno/drm/freedreno_ringbuffer.c
@@ -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;
 }
 



More information about the mesa-commit mailing list