Module Name: src Committed By: riastradh Date: Sun Dec 19 01:20:22 UTC 2021
Modified Files: src/sys/external/bsd/drm2/include/linux: reservation.h src/sys/external/bsd/drm2/linux: linux_reservation.c Log Message: reservation_object_get_excl_rcu To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 \ src/sys/external/bsd/drm2/include/linux/reservation.h cvs rdiff -u -r1.15 -r1.16 \ src/sys/external/bsd/drm2/linux/linux_reservation.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/include/linux/reservation.h diff -u src/sys/external/bsd/drm2/include/linux/reservation.h:1.9 src/sys/external/bsd/drm2/include/linux/reservation.h:1.10 --- src/sys/external/bsd/drm2/include/linux/reservation.h:1.9 Sun Dec 19 00:28:37 2021 +++ src/sys/external/bsd/drm2/include/linux/reservation.h Sun Dec 19 01:20:22 2021 @@ -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 @@ struct reservation_poll { #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_excl_fence(s 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 ***); Index: src/sys/external/bsd/drm2/linux/linux_reservation.c diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.15 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.16 --- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.15 Sun Dec 19 00:31:43 2021 +++ src/sys/external/bsd/drm2/linux/linux_reservation.c Sun Dec 19 01:20:22 2021 @@ -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 @@ reservation_object_add_shared_fence(stru 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)