pub struct Device<T: Driver, C: DeviceContext = Registered> { /* private fields */ }Expand description
A typed DRM device with a specific drm::Driver implementation and DeviceContext.
Since DRM devices can be used before being fully initialized and registered with userspace, C
represents the furthest DeviceContext we can guarantee that this Device has reached.
Keep in mind: this means that an unregistered device can still have the registration state
Registered as long as it was registered with userspace once in the past, and that the
behavior of such a device is still well-defined. Additionally, a device with the registration
state Uninit simply does not have a guaranteed registration state at compile time, and could
be either registered or unregistered. Since there is no way to guarantee a long-lived reference
to an unregistered device would remain unregistered, we do not provide a DeviceContext for
this.
§Invariants
self.devis a valid instance of astruct device.- The data layout of
Selfremains the same across all implementations ofC. - Any invariants for
Calso apply.
Trait Implementations§
Source§impl<T: Driver, C: DeviceContext> AlwaysRefCounted for Device<T, C>
impl<T: Driver, C: DeviceContext> AlwaysRefCounted for Device<T, C>
impl<T, C, const ID: u64> HasDelayedWork<Device<T, C>, ID> for Device<T, C>
Source§impl<T, C, const ID: u64> HasWork<Device<T, C>, ID> for Device<T, C>
impl<T, C, const ID: u64> HasWork<Device<T, C>, ID> for Device<T, C>
Source§unsafe fn raw_get_work(ptr: *mut Self) -> *mut Work<Self, ID>
unsafe fn raw_get_work(ptr: *mut Self) -> *mut Work<Self, ID>
Work<T, ID> field. Read moreSource§unsafe fn work_container_of(ptr: *mut Work<Self, ID>) -> *mut Self
unsafe fn work_container_of(ptr: *mut Work<Self, ID>) -> *mut Self
Work<T, ID> field. Read moreimpl<T: Driver, C: DeviceContext> Send for Device<T, C>
impl<T: Driver, C: DeviceContext> Sync for Device<T, C>
Auto Trait Implementations§
impl<T, C = Registered> !Freeze for Device<T, C>
impl<T, C = Registered> !RefUnwindSafe for Device<T, C>
impl<T, C = Registered> !Unpin for Device<T, C>
impl<T, C = Registered> !UnsafeUnpin for Device<T, C>
impl<T, C> UnwindSafe for Device<T, C>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot. Read more