Skip to main content

Paused

Struct Paused 

Source
pub struct Paused { /* private fields */ }
Expand description

A cursor renderer whose device has gone away.

A session pause revokes the descriptor: the kernel state behind it is gone, so the buffers cannot be destroyed and the framebuffers cannot be removed – those ioctls would go to a dead descriptor, or worse to whatever the number has since been reused for.

The mappings are a different matter and are released here. Closing a descriptor does not unmap anything – a VMA holds its own reference to the file – so a compositor that skipped this would leak one mapping per VT switch, quietly, for as long as it ran.

This exists as a type rather than a flag so that a paused renderer cannot be committed. There is nothing to commit to.

Implementations§

Source§

impl Paused

Source

pub fn resume(self, device: &Device) -> Result<Renderer<'_>, CursorError>

Rebuild on a new descriptor.

The same plane, the same size, and the cursor redrawn at whatever frame it had reached – so the first commit after a resume carries the right pixels rather than an empty buffer or a stale one.

The size is not re-probed. The hardware has not changed, and a resume is when a compositor is trying to get something on screen quickly rather than spend test commits rediscovering what it already knew.

§Errors

CursorError::Io if the buffers cannot be reallocated or the plane’s properties cannot be read on the new descriptor.

Source

pub const fn has_cursor(&self) -> bool

Whether a cursor is still loaded, and will be redrawn on resume.

Trait Implementations§

Source§

impl Debug for Paused

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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

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.