Module Name: src
Committed By: riastradh
Date: Sun Dec 19 12:11:05 UTC 2021
Modified Files:
src/sys/external/bsd/drm2/linux: linux_dma_fence.c
Log Message:
drm: Set fence timestamps -- i915 uses them.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/external/bsd/drm2/linux/linux_dma_fence.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/linux/linux_dma_fence.c
diff -u src/sys/external/bsd/drm2/linux/linux_dma_fence.c:1.24 src/sys/external/bsd/drm2/linux/linux_dma_fence.c:1.25
--- src/sys/external/bsd/drm2/linux/linux_dma_fence.c:1.24 Sun Dec 19 12:10:51 2021
+++ src/sys/external/bsd/drm2/linux/linux_dma_fence.c Sun Dec 19 12:11:05 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_dma_fence.c,v 1.24 2021/12/19 12:10:51 riastradh Exp $ */
+/* $NetBSD: linux_dma_fence.c,v 1.25 2021/12/19 12:11:05 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.24 2021/12/19 12:10:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.25 2021/12/19 12:11:05 riastradh Exp $");
#include <sys/atomic.h>
#include <sys/condvar.h>
@@ -644,6 +644,10 @@ dma_fence_signal_locked(struct dma_fence
if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
return -EINVAL;
+ /* Set the timestamp. */
+ fence->timestamp = ktime_get();
+ set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
+
/* Wake waiters. */
cv_broadcast(&fence->f_cv);
@@ -989,8 +993,9 @@ __dma_fence_signal(struct dma_fence *fen
/*
* __dma_fence_signal_wake(fence)
*
- * Wake fence's waiters. Caller must have previously called
- * __dma_fence_signal and it must have previously returned true.
+ * Set fence's timestamp and wake fence's waiters. Caller must
+ * have previously called __dma_fence_signal and it must have
+ * previously returned true.
*/
void
__dma_fence_signal_wake(struct dma_fence *fence, ktime_t timestamp)
@@ -1004,6 +1009,10 @@ __dma_fence_signal_wake(struct dma_fence
KASSERT(fence->flags & DMA_FENCE_FLAG_SIGNALED_BIT);
+ /* Set the timestamp. */
+ fence->timestamp = timestamp;
+ set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
+
/* Wake waiters. */
cv_broadcast(&fence->f_cv);