Module Name: src Committed By: riastradh Date: Sun Dec 19 01:48:04 UTC 2021
Modified Files: src/sys/external/bsd/drm2/include/linux: reservation.h src/sys/external/bsd/drm2/linux: linux_reservation.c Log Message: Add some more reservation API. Define reservation_object_assert_held. Just declare reservation_object_copy_fences for now, will implement later. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 \ src/sys/external/bsd/drm2/include/linux/reservation.h cvs rdiff -u -r1.20 -r1.21 \ 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.15 src/sys/external/bsd/drm2/include/linux/reservation.h:1.16 --- src/sys/external/bsd/drm2/include/linux/reservation.h:1.15 Sun Dec 19 01:25:42 2021 +++ src/sys/external/bsd/drm2/include/linux/reservation.h Sun Dec 19 01:48:03 2021 @@ -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 @@ struct reservation_poll { #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 @@ int reservation_object_lock_interruptibl 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 @@ struct dma_fence * 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 *, Index: src/sys/external/bsd/drm2/linux/linux_reservation.c diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.20 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.21 --- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.20 Sun Dec 19 01:25:43 2021 +++ src/sys/external/bsd/drm2/linux/linux_reservation.c Sun Dec 19 01:48:03 2021 @@ -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_held(struct reservati } /* + * 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