Skip to main content

select_plane

Function select_plane 

Source
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 some other CRTC. Overlays are shared on many parts, and taking one that another output is using costs that output a layer; 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