pub fn select_plane(
registry: &PlaneRegistry,
crtc_index: u32,
forced: Option<u32>,
allow_legacy: bool,
prefer_legacy: bool,
bound_elsewhere: &dyn Fn(u32) -> bool,
) -> Result<SelectedPlane, CursorError>Expand description
Pick a plane for the cursor on crtc_index.
forced bypasses the search: the named plane is validated and taken, or
the call fails. That is a caller overriding policy, and silently ignoring
an override is worse than refusing it.
bound_elsewhere answers whether a plane is currently driving a CRTC –
any, this one included, as the reference asks. Taking an overlay that is
showing something costs whoever put it there a layer, on this output or
another; the search prefers a free one but will take a busy one rather
than fall back to legacy.
prefer_legacy takes the legacy path over a cursor plane that can carry
ARGB8888, which is the plane the legacy ioctls then drive. It needs
allow_legacy, and a forced plane overrides it.
§Errors
CursorError::NoPlanewhen nothing on this CRTC can carry a cursor andallow_legacyis false.CursorError::PlaneUnusablewhenforcednames a plane that does not exist, cannot feed this CRTC, or can take none ofCURSOR_FORMATSlinearly.