Re: [PATCH v2 7/9] rust: drm: gpuvm: add dump_gpuva_info to UniqueRefGpuVm
Alice Ryhl <[email protected]> Fri, 31 Jul 2026 13:01:26 +0000
| Newsgroups | dev.linux.lists.driver-core,org.freedesktop.lists.dri-devel,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 31, 2026 at 01:05:45AM +0800, Alvin Sun wrote: > Add method wrapping drm_debugfs_gpuva_info to dump GPU VA space > mappings into a seq_file. Needed by the Tyr gpuvas debugfs file. > > Signed-off-by: Alvin Sun <[email protected]> > --- > rust/kernel/drm/gpuvm/mod.rs | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/rust/kernel/drm/gpuvm/mod.rs b/rust/kernel/drm/gpuvm/mod.rs > index 20a08b3defeb8..9da88501a4206 100644 > --- a/rust/kernel/drm/gpuvm/mod.rs > +++ b/rust/kernel/drm/gpuvm/mod.rs > @@ -312,6 +312,14 @@ pub fn data_ref(&self) -> &T { > unsafe { &*self.0.data.get() } > } > > + /// Dumps GPU VA space info into a seq_file. > + /// > + /// Wraps the C `drm_debugfs_gpuva_info` function. > + pub fn dump_gpuva_info(&self, m: &crate::seq_file::SeqFile) -> Result { > + // SAFETY: `m.as_raw()` and `self.as_raw()` are valid by the type invariants. > + to_result(unsafe { bindings::drm_debugfs_gpuva_info(m.as_raw(), self.as_raw()) }) > + } This can be marked inline. Otherwise: Reviewed-by: Alice Ryhl <[email protected]>