[RFC PATCH 4/9] rust: dma_fence: expose the fence's seqno publically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Each fence has a linear increasing sequence number inside the execution
context, that can be used to decide which fence would be signaled later.
So, expose this attribute to the Rust drivers through a method.

Signed-off-by: Maíra Canal <mcanal@xxxxxxxxxx>
---
 rust/kernel/dma_fence.rs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/rust/kernel/dma_fence.rs b/rust/kernel/dma_fence.rs
index 176e6d250e6c..94fead520274 100644
--- a/rust/kernel/dma_fence.rs
+++ b/rust/kernel/dma_fence.rs
@@ -60,6 +60,13 @@ pub trait RawDmaFence: crate::private::Sealed {
         }
     }
 
+    /// Return the seqno from this fence
+    fn seqno(&self) -> u64 {
+        // SAFETY: We hold a reference to a dma_fence and every dma_fence holds
+        // a seqno.
+        unsafe { (*self.raw()).seqno }
+    }
+
     /// Signal completion of this fence
     fn signal(&self) -> Result {
         to_result(unsafe { bindings::dma_fence_signal(self.raw()) })
-- 
2.39.2




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux