pub struct OverlayReservation { /* private fields */ }Expand description
Overlay planes claimed for decorations, per CRTC.
Implementations§
Source§impl OverlayReservation
impl OverlayReservation
Sourcepub fn reserve(
&mut self,
registry: &PlaneRegistry,
crtc_index: u32,
fourcc: u32,
count: usize,
min_zpos: u64,
) -> Result<Vec<u32>, ReserveError>
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.
Sourcepub fn release(&mut self, crtc_index: u32)
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.
Sourcepub fn reserved_for(&self, crtc_index: u32) -> &[u32]
pub fn reserved_for(&self, crtc_index: u32) -> &[u32]
What this CRTC holds, in zpos order.
Sourcepub fn all_reserved(&self) -> Vec<u32>
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.