pub struct DrmCard { /* private fields */ }Expand description
An open DRM card node (e.g. /dev/dri/card0).
The fd is O_CLOEXEC and owned by this wrapper; it is closed on drop.
Implementations§
Source§impl DrmCard
impl DrmCard
Sourcepub fn open(path: &str) -> Result<Self, CoreError>
pub fn open(path: &str) -> Result<Self, CoreError>
Open a DRM primary node by device path.
§Errors
ENOENT/ENODEV: no such card node.EACCES/EPERM: insufficient privilege for the device node.
Sourcepub fn wait_vblank(&self) -> Result<Instant, CoreError>
pub fn wait_vblank(&self) -> Result<Instant, CoreError>
Block until the next vblank and return the monotonic instant the wait returned.
The reply t_sec/t_usec fields are deliberately ignored: they are
zeroed on msm display stacks. Only the wait-unblock instant is
trustworthy, so callers diff consecutive return values.
§Errors
EINTR: interrupted by a signal (safe to retry).EINVAL: the card does not support vblank waits.EBADF: the card fd was closed.
Auto Trait Implementations§
impl Freeze for DrmCard
impl RefUnwindSafe for DrmCard
impl Send for DrmCard
impl Sync for DrmCard
impl Unpin for DrmCard
impl UnsafeUnpin for DrmCard
impl UnwindSafe for DrmCard
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