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 reservation_object_get_excl_rcu
details: https://anonhg.NetBSD.org/src/rev/499b1f204037
branches: trunk
changeset: 1027948:499b1f204037
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 01:20:22 2021 +0000
description:
reservation_object_get_excl_rcu
diffstat:
sys/external/bsd/drm2/include/linux/reservation.h | 5 +++-
sys/external/bsd/drm2/linux/linux_reservation.c | 24 +++++++++++++++++++++-
2 files changed, 26 insertions(+), 3 deletions(-)
diffs (71 lines):
diff -r 1d21e429477c -r 499b1f204037 sys/external/bsd/drm2/include/linux/reservation.h
--- a/sys/external/bsd/drm2/include/linux/reservation.h Sun Dec 19 01:20:15 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/reservation.h Sun Dec 19 01:20:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: reservation.h,v 1.9 2021/12/19 00:28:37 riastradh Exp $ */
+/* $NetBSD: reservation.h,v 1.10 2021/12/19 01:20:22 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@
#define reservation_object_add_shared_fence linux_reservation_object_add_shared_fence
#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
#define reservation_object_get_fences_rcu linux_reservation_object_get_fences_rcu
#define reservation_object_get_list linux_reservation_object_get_list
#define reservation_object_held linux_reservation_object_held
@@ -93,6 +94,8 @@
void reservation_object_add_shared_fence(struct reservation_object *,
struct dma_fence *);
+struct dma_fence *
+ reservation_object_get_excl_rcu(struct reservation_object *);
int reservation_object_get_fences_rcu(struct reservation_object *,
struct dma_fence **, unsigned *, struct dma_fence ***);
diff -r 1d21e429477c -r 499b1f204037 sys/external/bsd/drm2/linux/linux_reservation.c
--- a/sys/external/bsd/drm2/linux/linux_reservation.c Sun Dec 19 01:20:15 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_reservation.c Sun Dec 19 01:20:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_reservation.c,v 1.15 2021/12/19 00:31:43 riastradh Exp $ */
+/* $NetBSD: linux_reservation.c,v 1.16 2021/12/19 01:20:22 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.15 2021/12/19 00:31:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.16 2021/12/19 01:20:22 riastradh Exp $");
#include <sys/param.h>
#include <sys/poll.h>
@@ -474,6 +474,26 @@
dma_fence_put(replace);
}
+/*
+ * reservation_object_get_excl_rcu(robj)
+ *
+ * Note: Caller need not call this from an RCU read section.
+ */
+struct dma_fence *
+reservation_object_get_excl_rcu(struct reservation_object *robj)
+{
+ struct dma_fence *fence;
+
+ rcu_read_lock();
+ fence = dma_fence_get_rcu_safe(&robj->robj_fence);
+ rcu_read_unlock();
+
+ return fence;
+}
+
+/*
+ * reservation_object_get_fences_rcu(robj, fencep, nsharedp, sharedp)
+ */
int
reservation_object_get_fences_rcu(struct reservation_object *robj,
struct dma_fence **fencep, unsigned *nsharedp, struct dma_fence ***sharedp)
Home |
Main Index |
Thread Index |
Old Index