Re: [PATCH 1/4] rust: drm/gpuvm: add GpuVa::data_ref accessor

From: Danilo Krummrich

Date: Tue Nov 17 2026 - 14:40:35 EST


On 11/17/26 8:32 PM, Alice Ryhl wrote:
> From: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
>
> 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 <samitolvanen@xxxxxxxxxx>
> [aliceryhl: split into separate gpuvm and iommu commits]
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

One question below, otherwise:

Acked-by: Danilo Krummrich <dakr@xxxxxxxxxx>

> ---
> 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
> + }
> +
Why data_ref() instead of just data() or a Deref impl?