From: Sami Tolvanen <[email protected]>

Tyr's VM_BIND remap path rebuilds page-table mappings for the fragments
that survive a split, and those fragments must keep the protection flags
of the original mapping. Add GpuVa::data_ref() so the remap step can
read the VaData of an existing mapping.

Signed-off-by: Sami Tolvanen <[email protected]>
[aliceryhl: split into separate gpuvm and iommu commits]
Signed-off-by: Alice Ryhl <[email protected]>
---
 rust/kernel/drm/gpuvm/va.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/rust/kernel/drm/gpuvm/va.rs b/rust/kernel/drm/gpuvm/va.rs
index 46493f0ec5a6..f81302faba61 100644
--- a/rust/kernel/drm/gpuvm/va.rs
+++ b/rust/kernel/drm/gpuvm/va.rs
@@ -87,6 +87,12 @@ pub fn obj(&self) -> &T::Object {
         unsafe { <T::Object as 
IntoGEMObject>::from_raw((*self.as_raw()).gem.obj) }
     }
 
+    /// Access the driver-private [`VaData`](DriverGpuVm::VaData) associated 
with this mapping.
+    #[inline]
+    pub fn data_ref(&self) -> &T::VaData {
+        &self.data
+    }
+
     /// Returns the underlying [`GpuVmBo`] object that backs this [`GpuVa`].
     #[inline]
     pub fn vm_bo(&self) -> &GpuVmBo<T> {

-- 
2.56.1.703.gf848ed807c-goog

Reply via email to