Skip to main content

DrmCard

Struct DrmCard 

Source
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

Source

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.
Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.