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 drm: Set fence timestamps -- i91...



details:   https://anonhg.NetBSD.org/src/rev/a18d60274863
branches:  trunk
changeset: 1028841:a18d60274863
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:11:05 2021 +0000

description:
drm: Set fence timestamps -- i915 uses them.

diffstat:

 sys/external/bsd/drm2/linux/linux_dma_fence.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r d7647e9f1afb -r a18d60274863 sys/external/bsd/drm2/linux/linux_dma_fence.c
--- a/sys/external/bsd/drm2/linux/linux_dma_fence.c     Sun Dec 19 12:10:58 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_fence.c     Sun Dec 19 12:11:05 2021 +0000
@@ -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 @@
        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_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 @@
 
        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);
 



Home | Main Index | Thread Index | Old Index