Skip to main content

OverlayReservation

Struct OverlayReservation 

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

Overlay planes claimed for decorations, per CRTC.

Implementations§

Source§

impl OverlayReservation

Source

pub fn new() -> Self

An empty reservation.

Source

pub fn reserve( &mut self, registry: &PlaneRegistry, crtc_index: u32, fourcc: u32, count: usize, min_zpos: u64, ) -> Result<Vec<u32>, ReserveError>

Claim count overlay planes on crtc_index that can scan out fourcc.

Returns them in ascending zpos order, which is the order a caller stacks decorations in: the lowest is the one behind.

min_zpos excludes planes that cannot sit above the window. A decoration below the content it decorates is invisible, so a caller that knows the window’s stacking position passes it here rather than discovering the problem on screen.

Re-reserving a CRTC releases what it held first — except with a count of zero, which, as upstream, returns early and leaves an existing claim in place. A caller responding to a mode change asks again with a new count, and the old claim would otherwise keep planes it no longer wants out of everyone else’s reach; to give them all up, call release.

§Errors

ReserveError::Shortfall when fewer than count planes match. This CRTC’s previous claim has already been released and nothing new is claimed — no partial fill: a caller that asked for three and got two would have to work out which of its decorations to drop.

Source

pub fn release(&mut self, crtc_index: u32)

Give back everything this CRTC holds.

A CRTC that holds nothing, or was never reserved for, is a no-op — both are what a caller tearing down an output does, sometimes twice.

Source

pub fn reserved_for(&self, crtc_index: u32) -> &[u32]

What this CRTC holds, in zpos order.

Source

pub fn all_reserved(&self) -> Vec<u32>

Every claimed plane, across every CRTC.

What goes to Allocator::set_reserved_planes, which is why it is one list rather than a map: the allocator is told which planes it may not have, and it does not care who has them.

Trait Implementations§

Source§

impl Debug for OverlayReservation

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for OverlayReservation

Source§

fn default() -> Self

Returns the “default value” for a type. 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.