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 Add some more reservation API.



details:   https://anonhg.NetBSD.org/src/rev/d3af9a5c8016
branches:  trunk
changeset: 1028077:d3af9a5c8016
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:48:03 2021 +0000

description:
Add some more reservation API.

Define reservation_object_assert_held.

Just declare reservation_object_copy_fences for now, will implement
later.

diffstat:

 sys/external/bsd/drm2/include/linux/reservation.h |   8 +++++++-
 sys/external/bsd/drm2/linux/linux_reservation.c   |  16 ++++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)

diffs (73 lines):

diff -r f4289ed2ab70 -r d3af9a5c8016 sys/external/bsd/drm2/include/linux/reservation.h
--- a/sys/external/bsd/drm2/include/linux/reservation.h Sun Dec 19 01:47:55 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/reservation.h Sun Dec 19 01:48:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: reservation.h,v 1.15 2021/12/19 01:25:42 riastradh Exp $       */
+/*     $NetBSD: reservation.h,v 1.16 2021/12/19 01:48:03 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -64,6 +64,8 @@
 
 #define        reservation_object_add_excl_fence       linux_reservation_object_add_excl_fence
 #define        reservation_object_add_shared_fence     linux_reservation_object_add_shared_fence
+#define        reservation_object_assert_held          linux_reservation_object_assert_held
+#define        reservation_object_copy_fences          linux_reservation_object_copy_fences
 #define        reservation_object_fini                 linux_reservation_object_fini
 #define        reservation_object_get_excl             linux_reservation_object_get_excl
 #define        reservation_object_get_excl_rcu         linux_reservation_object_get_excl_rcu
@@ -95,6 +97,7 @@
 bool   reservation_object_trylock(struct reservation_object *) __must_check;
 void   reservation_object_unlock(struct reservation_object *);
 bool   reservation_object_held(struct reservation_object *);
+void   reservation_object_assert_held(struct reservation_object *);
 struct dma_fence *
        reservation_object_get_excl(struct reservation_object *);
 struct reservation_object_list *
@@ -110,6 +113,9 @@
 int    reservation_object_get_fences_rcu(struct reservation_object *,
            struct dma_fence **, unsigned *, struct dma_fence ***);
 
+int    reservation_object_copy_fences(struct reservation_object *,
+           const struct reservation_object *);
+
 bool   reservation_object_test_signaled_rcu(struct reservation_object *,
            bool);
 long   reservation_object_wait_timeout_rcu(struct reservation_object *,
diff -r f4289ed2ab70 -r d3af9a5c8016 sys/external/bsd/drm2/linux/linux_reservation.c
--- a/sys/external/bsd/drm2/linux/linux_reservation.c   Sun Dec 19 01:47:55 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_reservation.c   Sun Dec 19 01:48:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_reservation.c,v 1.20 2021/12/19 01:25:43 riastradh Exp $ */
+/*     $NetBSD: linux_reservation.c,v 1.21 2021/12/19 01:48:03 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.20 2021/12/19 01:25:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.21 2021/12/19 01:48:03 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/poll.h>
@@ -190,6 +190,18 @@
 }
 
 /*
+ * reservation_object_assert_held(robj)
+ *
+ *     Panic if robj is not held, in DIAGNOSTIC builds.
+ */
+void
+reservation_object_assert_held(struct reservation_object *robj)
+{
+
+       KASSERT(reservation_object_held(robj));
+}
+
+/*
  * reservation_object_get_excl(robj)
  *
  *     Return a pointer to the exclusive fence of the reservation



Home | Main Index | Thread Index | Old Index