* [PATCH] rust: DmaFence: Implement Deref for FenceContext
@ 2026-10-22 16:21 Philipp Stanner
0 siblings, 0 replies; only message in thread
From: Philipp Stanner @ 2026-10-22 16:21 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Sumit Semwal, Christian König,
Philipp Stanner, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan
Cc: linux-media, dri-devel, rust-for-linux, linux-kernel
A FenceContext carries data, which the user should be able to access.
Implement Deref for FenceContext.
Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
rust/kernel/dma_buf/dma_fence.rs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/rust/kernel/dma_buf/dma_fence.rs b/rust/kernel/dma_buf/dma_fence.rs
index a1d851656562..5300448882e7 100644
--- a/rust/kernel/dma_buf/dma_fence.rs
+++ b/rust/kernel/dma_buf/dma_fence.rs
@@ -86,6 +86,15 @@ pub struct FenceContext<T: FenceContextOps + Send + Sync> {
data: T,
}
+impl<T: Send + Sync + FenceContextOps> Deref for FenceContext<T> {
+ type Target = T;
+
+ #[inline]
+ fn deref(&self) -> &Self::Target {
+ &self.data
+ }
+}
+
impl<'a, T: Send + Sync + FenceContextOps> FenceContext<T> {
// This can later be extended as a vtable in case other parties need support
// for the more "exotic" callbacks.
base-commit: 3497a403264b094ebd61b8b755165d56e7d9dc37
--
2.56.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-22 16:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 16:21 [PATCH] rust: DmaFence: Implement Deref for FenceContext Philipp Stanner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®