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 fence -> dma_fence in linux_rese...



details:   https://anonhg.NetBSD.org/src/rev/6ee72288bb58
branches:  trunk
changeset: 1027788:6ee72288bb58
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 00:31:43 2021 +0000

description:
fence -> dma_fence in linux_reservation.c.

diffstat:

 sys/external/bsd/drm2/linux/linux_reservation.c |  112 ++++++++++++------------
 1 files changed, 56 insertions(+), 56 deletions(-)

diffs (truncated from 356 to 300 lines):

diff -r 3efe3cc9ff0e -r 6ee72288bb58 sys/external/bsd/drm2/linux/linux_reservation.c
--- a/sys/external/bsd/drm2/linux/linux_reservation.c   Sun Dec 19 00:31:35 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_reservation.c   Sun Dec 19 00:31:43 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_reservation.c,v 1.14 2021/08/02 23:14:15 riastradh Exp $ */
+/*     $NetBSD: linux_reservation.c,v 1.15 2021/12/19 00:31:43 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,13 +30,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.14 2021/08/02 23:14:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.15 2021/12/19 00:31:43 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/poll.h>
 #include <sys/select.h>
 
-#include <linux/fence.h>
+#include <linux/dma-fence.h>
 #include <linux/reservation.h>
 #include <linux/ww_mutex.h>
 
@@ -111,11 +111,11 @@
                objlist_free(robj->robj_prealloc);
        if (robj->robj_list) {
                for (i = 0; i < robj->robj_list->shared_count; i++)
-                       fence_put(robj->robj_list->shared[i]);
+                       dma_fence_put(robj->robj_list->shared[i]);
                objlist_free(robj->robj_list);
        }
        if (robj->robj_fence)
-               fence_put(robj->robj_fence);
+               dma_fence_put(robj->robj_fence);
        ww_mutex_destroy(&robj->lock);
 }
 
@@ -139,7 +139,7 @@
  *
  *     Caller must have robj locked.
  */
-struct fence *
+struct dma_fence *
 reservation_object_get_excl(struct reservation_object *robj)
 {
 
@@ -324,9 +324,9 @@
  */
 void
 reservation_object_add_excl_fence(struct reservation_object *robj,
-    struct fence *fence)
+    struct dma_fence *fence)
 {
-       struct fence *old_fence = robj->robj_fence;
+       struct dma_fence *old_fence = robj->robj_fence;
        struct reservation_object_list *old_list = robj->robj_list;
        uint32_t old_shared_count;
        struct reservation_object_write_ticket ticket;
@@ -338,7 +338,7 @@
         * a reference for ourselves.
         */
        if (fence)
-               (void)fence_get(fence);
+               (void)dma_fence_get(fence);
 
        /* If there are any shared fences, remember how many.  */
        if (old_list)
@@ -357,12 +357,12 @@
 
        /* Release the old exclusive fence, if any.  */
        if (old_fence)
-               fence_put(old_fence);
+               dma_fence_put(old_fence);
 
        /* Release any old shared fences.  */
        if (old_list) {
                while (old_shared_count--)
-                       fence_put(old_list->shared[old_shared_count]);
+                       dma_fence_put(old_list->shared[old_shared_count]);
        }
 }
 
@@ -379,19 +379,19 @@
  */
 void
 reservation_object_add_shared_fence(struct reservation_object *robj,
-    struct fence *fence)
+    struct dma_fence *fence)
 {
        struct reservation_object_list *list = robj->robj_list;
        struct reservation_object_list *prealloc = robj->robj_prealloc;
        struct reservation_object_write_ticket ticket;
-       struct fence *replace = NULL;
+       struct dma_fence *replace = NULL;
        uint32_t i;
 
        KASSERT(reservation_object_held(robj));
 
        /* Acquire a reference to the fence.  */
        KASSERT(fence != NULL);
-       (void)fence_get(fence);
+       (void)dma_fence_get(fence);
 
        /* Check for a preallocated replacement list.  */
        if (prealloc == NULL) {
@@ -471,16 +471,16 @@
 
        /* Release a fence if we replaced it.  */
        if (replace)
-               fence_put(replace);
+               dma_fence_put(replace);
 }
 
 int
 reservation_object_get_fences_rcu(struct reservation_object *robj,
-    struct fence **fencep, unsigned *nsharedp, struct fence ***sharedp)
+    struct dma_fence **fencep, unsigned *nsharedp, struct dma_fence ***sharedp)
 {
        struct reservation_object_list *list;
-       struct fence *fence;
-       struct fence **shared = NULL;
+       struct dma_fence *fence;
+       struct dma_fence **shared = NULL;
        unsigned shared_alloc, shared_count, i;
        struct reservation_object_read_ticket ticket;
 
@@ -563,7 +563,7 @@
         * one.  If we can't, start over.
         */
        if (fence) {
-               if (fence_get_rcu(fence) == NULL)
+               if (dma_fence_get_rcu(fence) == NULL)
                        goto restart;
        }
 
@@ -571,7 +571,7 @@
         * Try to get a reference to all of the shared fences.
         */
        for (i = 0; i < shared_count; i++) {
-               if (fence_get_rcu(shared[i]) == NULL)
+               if (dma_fence_get_rcu(shared[i]) == NULL)
                        goto put_restart;
        }
 
@@ -585,11 +585,11 @@
 put_restart:
        /* Back out.  */
        while (i --> 0) {
-               fence_put(shared[i]);
+               dma_fence_put(shared[i]);
                shared[i] = NULL; /* paranoia */
        }
        if (fence) {
-               fence_put(fence);
+               dma_fence_put(fence);
                fence = NULL;   /* paranoia */
        }
 
@@ -615,7 +615,7 @@
 {
        struct reservation_object_read_ticket ticket;
        struct reservation_object_list *list;
-       struct fence *fence;
+       struct dma_fence *fence;
        uint32_t i, shared_count;
        bool signaled = true;
 
@@ -646,11 +646,11 @@
                 * signalled.
                 */
                for (i = 0; i < shared_count; i++) {
-                       fence = fence_get_rcu(list->shared[i]);
+                       fence = dma_fence_get_rcu(list->shared[i]);
                        if (fence == NULL)
                                goto restart;
-                       signaled &= fence_is_signaled(fence);
-                       fence_put(fence);
+                       signaled &= dma_fence_is_signaled(fence);
+                       dma_fence_put(fence);
                        if (!signaled)
                                goto out;
                }
@@ -674,10 +674,10 @@
                 * If it is going away, restart.  Otherwise, acquire a
                 * reference to it to test whether it is signalled.
                 */
-               if ((fence = fence_get_rcu(fence)) == NULL)
+               if ((fence = dma_fence_get_rcu(fence)) == NULL)
                        goto restart;
-               signaled &= fence_is_signaled(fence);
-               fence_put(fence);
+               signaled &= dma_fence_is_signaled(fence);
+               dma_fence_put(fence);
                if (!signaled)
                        goto out;
        }
@@ -709,7 +709,7 @@
 {
        struct reservation_object_read_ticket ticket;
        struct reservation_object_list *list;
-       struct fence *fence;
+       struct dma_fence *fence;
        uint32_t i, shared_count;
        long ret;
 
@@ -743,12 +743,12 @@
                 * is not signalled.
                 */
                for (i = 0; i < shared_count; i++) {
-                       fence = fence_get_rcu(list->shared[i]);
+                       fence = dma_fence_get_rcu(list->shared[i]);
                        if (fence == NULL)
                                goto restart;
-                       if (!fence_is_signaled(fence))
+                       if (!dma_fence_is_signaled(fence))
                                goto wait;
-                       fence_put(fence);
+                       dma_fence_put(fence);
                }
        }
 
@@ -771,11 +771,11 @@
                 * reference to it to test whether it is signalled.  If
                 * not, wait for it.
                 */
-               if ((fence = fence_get_rcu(fence)) == NULL)
+               if ((fence = dma_fence_get_rcu(fence)) == NULL)
                        goto restart;
-               if (!fence_is_signaled(fence))
+               if (!dma_fence_is_signaled(fence))
                        goto wait;
-               fence_put(fence);
+               dma_fence_put(fence);
        }
 
        /* Success!  Return the number of ticks left.  */
@@ -793,8 +793,8 @@
         */
        KASSERT(fence != NULL);
        rcu_read_unlock();
-       ret = fence_wait_timeout(fence, intr, timeout);
-       fence_put(fence);
+       ret = dma_fence_wait_timeout(fence, intr, timeout);
+       dma_fence_put(fence);
        if (ret <= 0)
                return ret;
        KASSERT(ret <= timeout);
@@ -841,7 +841,7 @@
  *     spuriously notify them about a shared fence, tough.
  */
 static void
-reservation_poll_cb(struct fence *fence, struct fence_cb *fcb)
+reservation_poll_cb(struct dma_fence *fence, struct dma_fence_cb *fcb)
 {
        struct reservation_poll *rpoll = container_of(fcb,
            struct reservation_poll, rp_fcb);
@@ -871,7 +871,7 @@
 {
        struct reservation_object_read_ticket ticket;
        struct reservation_object_list *list;
-       struct fence *fence;
+       struct dma_fence *fence;
        uint32_t i, shared_count;
        int revents;
        bool recorded = false;  /* curlwp is on the selq */
@@ -915,14 +915,14 @@
                 * find any that is not signalled.
                 */
                for (i = 0; i < shared_count; i++) {
-                       fence = fence_get_rcu(list->shared[i]);
+                       fence = dma_fence_get_rcu(list->shared[i]);
                        if (fence == NULL)
                                goto restart;
-                       if (!fence_is_signaled(fence)) {
-                               fence_put(fence);
+                       if (!dma_fence_is_signaled(fence)) {
+                               dma_fence_put(fence);
                                break;
                        }
-                       fence_put(fence);
+                       dma_fence_put(fence);
                }
 
                /* If all shared fences have been signalled, move on.  */
@@ -951,17 +951,17 @@
                 * callback later.
                 */
                for (i = 0; i < shared_count; i++) {
-                       fence = fence_get_rcu(list->shared[i]);
+                       fence = dma_fence_get_rcu(list->shared[i]);
                        if (fence == NULL)
                                goto restart;
-                       if (!fence_add_callback(fence, &rpoll->rp_fcb,
+                       if (!dma_fence_add_callback(fence, &rpoll->rp_fcb,
                                reservation_poll_cb)) {
-                               fence_put(fence);
+                               dma_fence_put(fence);
                                revents &= ~POLLOUT;



Home | Main Index | Thread Index | Old Index