pub struct GpuVa<T: DriverGpuVm> { /* private fields */ }Expand description
Represents that a range of a GEM object is mapped in this GpuVm instance.
Does not assume that GEM lock is held.
§Invariants
- This is a valid
drm_gpuvaobject that is resident in aGpuVm<T>instance. - It is associated with a
GpuVmBo<T>. Or in other words, it’s not angpuvm->kernel_alloc_nodeandDRM_GPUVA_SPARSEis not set. - The associated
GpuVmBo<T>is part of the GEM list.
Implementations§
Source§impl<T: DriverGpuVm> GpuVa<T>
impl<T: DriverGpuVm> GpuVa<T>
Source§impl<T: DriverGpuVm> GpuVa<T>
impl<T: DriverGpuVm> GpuVa<T>
Sourcepub unsafe fn from_raw<'a>(ptr: *mut drm_gpuva) -> &'a Self
pub unsafe fn from_raw<'a>(ptr: *mut drm_gpuva) -> &'a Self
Access this GpuVa from a raw pointer.
§Safety
- For the duration of
'a, the pointer must reference a validdrm_gpuvaassociated with aGpuVm<T>. - It must be associated with a
GpuVmBo<T>. - The associated
GpuVmBo<T>is part of the GEM list.
Sourcepub fn addr(&self) -> u64
pub fn addr(&self) -> u64
Returns the address of this mapping in the GPU virtual address space.
Sourcepub fn gem_offset(&self) -> u64
pub fn gem_offset(&self) -> u64
Returns the offset within the GEM object.
Trait Implementations§
impl<T: DriverGpuVm> Eq for GpuVa<T>
Source§impl<T: DriverGpuVm> HasPinData for GpuVa<T>
impl<T: DriverGpuVm> HasPinData for GpuVa<T>
Auto Trait Implementations§
impl<T> !Freeze for GpuVa<T>
impl<T> !RefUnwindSafe for GpuVa<T>
impl<T> !Send for GpuVa<T>
impl<T> !Sync for GpuVa<T>
impl<T> !UnsafeUnpin for GpuVa<T>
impl<T> UnwindSafe for GpuVa<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more