pub struct GpuVm<T: DriverGpuVm> { /* private fields */ }Expand description
A DRM GPU VA manager.
This object is refcounted, but the locations of mapped ranges may only be accessed or changed
via the special unique handle UniqueRefGpuVm.
§Invariants
- Stored in an allocation managed by the refcount in
self.vm. - Access to
dataand the gpuvm interval tree is controlled via theUniqueRefGpuVmtype. - Does not contain any sparse
GpuVa<T>instances.
Implementations§
Source§impl<T: DriverGpuVm> GpuVm<T>
impl<T: DriverGpuVm> GpuVm<T>
Source§impl<T: DriverGpuVm> GpuVm<T>
impl<T: DriverGpuVm> GpuVm<T>
Sourcepub fn new<E, Ctx: DeviceContext>(
name: &'static CStr,
dev: &Device<T::Driver, Ctx>,
r_obj: &T::Object,
range: Range<u64>,
reserve_range: Range<u64>,
data: T,
) -> Result<UniqueRefGpuVm<T>, E>
pub fn new<E, Ctx: DeviceContext>( name: &'static CStr, dev: &Device<T::Driver, Ctx>, r_obj: &T::Object, range: Range<u64>, reserve_range: Range<u64>, data: T, ) -> Result<UniqueRefGpuVm<T>, E>
Creates a GPUVM instance.
Sourcepub fn obtain(
&self,
obj: &T::Object,
data: impl PinInit<T::VmBoData>,
) -> Result<ARef<GpuVmBo<T>>, AllocError>
pub fn obtain( &self, obj: &T::Object, data: impl PinInit<T::VmBoData>, ) -> Result<ARef<GpuVmBo<T>>, AllocError>
Get or create the GpuVmBo for this gem object.
Sourcepub fn deferred_cleanup(&self)
pub fn deferred_cleanup(&self)
Clean up buffer objects that are no longer used.
Trait Implementations§
Source§impl<T: DriverGpuVm> AlwaysRefCounted for GpuVm<T>
impl<T: DriverGpuVm> AlwaysRefCounted for GpuVm<T>
impl<T: DriverGpuVm> Eq for GpuVm<T>
Source§impl<T: DriverGpuVm> HasPinData for GpuVm<T>
impl<T: DriverGpuVm> HasPinData for GpuVm<T>
Source§impl<T: DriverGpuVm> PartialEq for GpuVm<T>
impl<T: DriverGpuVm> PartialEq for GpuVm<T>
impl<T: DriverGpuVm> Send for GpuVm<T>
impl<T: DriverGpuVm> Sync for GpuVm<T>
Auto Trait Implementations§
impl<T> !Freeze for GpuVm<T>
impl<T> !RefUnwindSafe for GpuVm<T>
impl<T> !UnsafeUnpin for GpuVm<T>
impl<T> UnwindSafe for GpuVm<T>where
T: UnwindSafe,
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