Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/linux drm: Convert membar_enter/exit s...



details:   https://anonhg.NetBSD.org/src/rev/4d5e0133fff8
branches:  trunk
changeset: 365162:4d5e0133fff8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Apr 09 23:44:44 2022 +0000

description:
drm: Convert membar_enter/exit stragglers to membar_acquire/release.

diffstat:

 sys/external/bsd/drm2/linux/linux_dma_buf.c         |  8 ++++----
 sys/external/bsd/drm2/linux/linux_dma_fence.c       |  8 ++++----
 sys/external/bsd/drm2/linux/linux_dma_fence_chain.c |  6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diffs (88 lines):

diff -r 4c5aab528985 -r 4d5e0133fff8 sys/external/bsd/drm2/linux/linux_dma_buf.c
--- a/sys/external/bsd/drm2/linux/linux_dma_buf.c       Sat Apr 09 23:44:25 2022 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_buf.c       Sat Apr 09 23:44:44 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_buf.c,v 1.14 2022/02/17 01:38:38 riastradh Exp $     */
+/*     $NetBSD: linux_dma_buf.c,v 1.15 2022/04/09 23:44:44 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.14 2022/02/17 01:38:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.15 2022/04/09 23:44:44 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -160,10 +160,10 @@
 dma_buf_put(struct dma_buf *dmabuf)
 {
 
-       membar_exit();
+       membar_release();
        if (atomic_dec_uint_nv(&dmabuf->db_refcnt) != 0)
                return;
-       membar_enter();
+       membar_acquire();
 
        dma_resv_poll_fini(&dmabuf->db_resv_poll);
        mutex_destroy(&dmabuf->db_lock);
diff -r 4c5aab528985 -r 4d5e0133fff8 sys/external/bsd/drm2/linux/linux_dma_fence.c
--- a/sys/external/bsd/drm2/linux/linux_dma_fence.c     Sat Apr 09 23:44:25 2022 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_fence.c     Sat Apr 09 23:44:44 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_fence.c,v 1.39 2021/12/19 12:39:40 riastradh Exp $   */
+/*     $NetBSD: linux_dma_fence.c,v 1.40 2022/04/09 23:44:44 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.39 2021/12/19 12:39:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.40 2022/04/09 23:44:44 riastradh Exp $");
 
 #include <sys/atomic.h>
 #include <sys/condvar.h>
@@ -245,9 +245,9 @@
        } S;
        uint64_t c;
 
-       while (__predict_false(atomic_cas_uint(&S.lock, 0, 1) != 0))
+       while (__predict_false(atomic_swap_uint(&S.lock, 1)))
                SPINLOCK_BACKOFF_HOOK;
-       membar_enter();
+       membar_acquire();
        c = S.context;
        S.context += n;
        atomic_store_release(&S.lock, 0);
diff -r 4c5aab528985 -r 4d5e0133fff8 sys/external/bsd/drm2/linux/linux_dma_fence_chain.c
--- a/sys/external/bsd/drm2/linux/linux_dma_fence_chain.c       Sat Apr 09 23:44:25 2022 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_fence_chain.c       Sat Apr 09 23:44:44 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_fence_chain.c,v 1.3 2021/12/19 12:39:32 riastradh Exp $      */
+/*     $NetBSD: linux_dma_fence_chain.c,v 1.4 2022/04/09 23:44:44 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence_chain.c,v 1.3 2021/12/19 12:39:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence_chain.c,v 1.4 2022/04/09 23:44:44 riastradh Exp $");
 
 #include <sys/types.h>
 
@@ -262,7 +262,7 @@
                                break;
                        splice = NULL;
                }
-               membar_exit();  /* pairs with dma_fence_get_rcu_safe */
+               membar_release();       /* pairs with dma_fence_get_rcu_safe */
                if (atomic_cas_ptr(&chain->dfc_prev, prev, splice) == prev)
                        dma_fence_put(prev); /* transferred to splice */
                else



Home | Main Index | Thread Index | Old Index