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 slow path versions of to drm...
details: https://anonhg.NetBSD.org/src/rev/e9f6f273a6a5
branches: trunk
changeset: 1028313:e9f6f273a6a5
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 10:36:55 2021 +0000
description:
Add slow path versions of to drm_resv_lock.
diffstat:
sys/external/bsd/drm2/include/linux/dma-resv.h | 8 ++++-
sys/external/bsd/drm2/linux/linux_dma_resv.c | 37 ++++++++++++++++++++++++-
2 files changed, 42 insertions(+), 3 deletions(-)
diffs (96 lines):
diff -r 4e383c0a7627 -r e9f6f273a6a5 sys/external/bsd/drm2/include/linux/dma-resv.h
--- a/sys/external/bsd/drm2/include/linux/dma-resv.h Sun Dec 19 10:36:47 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/dma-resv.h Sun Dec 19 10:36:55 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dma-resv.h,v 1.5 2021/12/19 10:19:53 riastradh Exp $ */
+/* $NetBSD: dma-resv.h,v 1.6 2021/12/19 10:36:55 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -77,6 +77,8 @@
#define dma_resv_kqfilter linux_dma_resv_kqfilter
#define dma_resv_lock linux_dma_resv_lock
#define dma_resv_lock_interruptible linux_dma_resv_lock_interruptible
+#define dma_resv_lock_slow linux_dma_resv_lock_slow
+#define dma_resv_lock_slow_interruptible linux_dma_resv_lock_slow_interruptible
#define dma_resv_reserve_shared linux_dma_resv_reserve_shared
#define dma_resv_test_signaled_rcu linux_dma_resv_test_signaled_rcu
#define dma_resv_trylock linux_dma_resv_trylock
@@ -92,8 +94,12 @@
void dma_resv_fini(struct dma_resv *);
int dma_resv_lock(struct dma_resv *,
struct ww_acquire_ctx *);
+void dma_resv_lock_slow(struct dma_resv *,
+ struct ww_acquire_ctx *);
int dma_resv_lock_interruptible(struct dma_resv *,
struct ww_acquire_ctx *);
+int dma_resv_lock_slow_interruptible(struct dma_resv *,
+ struct ww_acquire_ctx *);
bool dma_resv_trylock(struct dma_resv *) __must_check;
void dma_resv_unlock(struct dma_resv *);
bool dma_resv_held(struct dma_resv *);
diff -r 4e383c0a7627 -r e9f6f273a6a5 sys/external/bsd/drm2/linux/linux_dma_resv.c
--- a/sys/external/bsd/drm2/linux/linux_dma_resv.c Sun Dec 19 10:36:47 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_resv.c Sun Dec 19 10:36:55 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_dma_resv.c,v 1.1 2021/12/19 10:19:53 riastradh Exp $ */
+/* $NetBSD: linux_dma_resv.c,v 1.2 2021/12/19 10:36:55 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_resv.c,v 1.1 2021/12/19 10:19:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_resv.c,v 1.2 2021/12/19 10:36:55 riastradh Exp $");
#include <sys/param.h>
#include <sys/poll.h>
@@ -137,6 +137,22 @@
}
/*
+ * dma_resv_lock_slow(robj, ctx)
+ *
+ * Acquire a reservation object's lock. Caller must not hold
+ * this lock or any others -- this is to be used in slow paths
+ * after dma_resv_lock or dma_resv_lock_interruptible has failed
+ * and the caller has backed out all other locks.
+ */
+void
+dma_resv_lock_slow(struct dma_resv *robj,
+ struct ww_acquire_ctx *ctx)
+{
+
+ ww_mutex_lock_slow(&robj->lock, ctx);
+}
+
+/*
* dma_resv_lock_interruptible(robj, ctx)
*
* Acquire a reservation object's lock. Return 0 on success,
@@ -153,6 +169,23 @@
}
/*
+ * dma_resv_lock_slow_interruptible(robj, ctx)
+ *
+ * Acquire a reservation object's lock. Caller must not hold
+ * this lock or any others -- this is to be used in slow paths
+ * after dma_resv_lock or dma_resv_lock_interruptible has failed
+ * and the caller has backed out all other locks. Return 0 on
+ * success, -ERESTART/-EINTR if interrupted.
+ */
+int
+dma_resv_lock_slow_interruptible(struct dma_resv *robj,
+ struct ww_acquire_ctx *ctx)
+{
+
+ return ww_mutex_lock_slow_interruptible(&robj->lock, ctx);
+}
+
+/*
* dma_resv_trylock(robj)
*
* Try to acquire a reservation object's lock without blocking.
Home |
Main Index |
Thread Index |
Old Index