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/dist/drm/radeon Notify radeon_fence_de...
details: https://anonhg.NetBSD.org/src/rev/be931068916c
branches: trunk
changeset: 366275:be931068916c
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 27 14:20:26 2018 +0000
description:
Notify radeon_fence_default_wait on fence signal.
diffstat:
sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c | 21 ++++++++++++++++++-
1 files changed, 19 insertions(+), 2 deletions(-)
diffs (56 lines):
diff -r 81ee28d77b9b -r be931068916c sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c Mon Aug 27 14:20:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c Mon Aug 27 14:20:26 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radeon_fence.c,v 1.13 2018/08/27 13:34:50 riastradh Exp $ */
+/* $NetBSD: radeon_fence.c,v 1.14 2018/08/27 14:20:26 riastradh Exp $ */
/*
* Copyright 2009 Jerome Glisse.
@@ -31,7 +31,7 @@
* Dave Airlie
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_fence.c,v 1.13 2018/08/27 13:34:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_fence.c,v 1.14 2018/08/27 14:20:26 riastradh Exp $");
#include <linux/seq_file.h>
#include <linux/atomic.h>
@@ -1158,13 +1158,28 @@
#ifdef __NetBSD__
+static void
+radeon_fence_wakeup_cb(struct fence *fence, struct fence_cb *cb)
+{
+ struct radeon_fence *rfence = to_radeon_fence(fence);
+ struct radeon_device *rdev = rfence->rdev;
+
+ BUG_ON(!spin_is_locked(&rdev->fence_lock));
+ cv_broadcast(&rdev->fence_queue);
+}
+
static signed long
radeon_fence_default_wait(struct fence *f, bool intr, signed long timo)
{
+ struct fence_cb fcb;
struct radeon_fence *fence = to_radeon_fence(f);
struct radeon_device *rdev = fence->rdev;
int r;
+ r = fence_add_callback(f, &fcb, radeon_fence_wakeup_cb);
+ if (r)
+ return r;
+
spin_lock(&rdev->fence_lock);
if (intr) {
DRM_SPIN_TIMED_WAIT_UNTIL(r, &rdev->fence_queue,
@@ -1177,6 +1192,8 @@
}
spin_unlock(&rdev->fence_lock);
+ (void)fence_remove_callback(f, &fcb);
+
return r;
}
Home |
Main Index |
Thread Index |
Old Index