Skip to main content

Modeset

Struct Modeset 

Source
pub struct Modeset<'a> { /* private fields */ }
Expand description

The CRTC and connector writes that bring a display up.

Plane properties alone do not light a screen. Until the CRTC has a mode and is ACTIVE, and some connector routes to it, a commit that binds planes to that CRTC is rejected – and the planes have nowhere to scan out to even if it were not. Upstream folds these writes into the first commit after create() or rebind() and ORs in ALLOW_MODESET to let them through; this is the same set.

Easy to leave out and not notice: most desktops run a DRM fbdev client that re-enables the CRTC as soon as the previous master drops it, so a scene that never writes these still commits successfully on a developer’s machine. It fails on a system that boots without one.

Implementations§

Source§

impl<'a> Modeset<'a>

Source

pub fn learn( device: &'a Device, crtc_id: u32, connector_id: u32, mode: &Mode, ) -> Result<Self, CoreError>

Resolve the three property ids and stage mode as a blob.

The blob is created once and reused for every commit: it describes the mode, which does not change while the scene is bound to this CRTC.

§Errors

CoreError if a property is missing – every atomic driver exposes all three, so an absent one means this is not an atomic-capable device – or if the kernel refuses the blob.

Source

pub fn emit(&self, request: &mut AtomicRequest) -> Result<usize, CoreError>

Emit the modeset writes. Returns how many properties were written.

§Errors

CoreError if a property write is rejected before the commit.

Source

pub const fn mode_blob(&self) -> u64

The blob id backing MODE_ID.

Auto Trait Implementations§

§

impl<'a> Freeze for Modeset<'a>

§

impl<'a> RefUnwindSafe for Modeset<'a>

§

impl<'a> Send for Modeset<'a>

§

impl<'a> Sync for Modeset<'a>

§

impl<'a> Unpin for Modeset<'a>

§

impl<'a> UnsafeUnpin for Modeset<'a>

§

impl<'a> UnwindSafe for Modeset<'a>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.