[PATCH v2 2/2] rust: drm: Add GPUVM abstraction

Daniel Almeida daniel.almeida at collabora.com
Tue Jun 10 21:06:20 UTC 2025


Hi Danilo,

[…]

> 
>> +
>> +impl<T: DriverGpuVm> OpMap<T> {
>> +    /// Returns the base address of the new mapping.
>> +    #[inline]
>> +    pub fn addr(&self) -> u64 {
>> +        self.0.va.addr
>> +    }
>> +
>> +    /// Returns the range of the new mapping.
>> +    #[inline]
>> +    pub fn range(&self) -> u64 {
>> +        self.0.va.range
>> +    }
>> +
>> +    /// Returns the offset within the GEM object.
>> +    #[inline]
>> +    pub fn offset(&self) -> u64 {
>> +        self.0.gem.offset
>> +    }
>> +
>> +    /// Returns the GEM object to map.
>> +    #[inline]
>> +    pub fn object(&self) -> &<T::Driver as drv::Driver>::Object {
> 
> You can use drm::Driver instead, which reads much better.

Can you expand a bit on this?


— Daniel


More information about the dri-devel mailing list