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
impl Paused
Sourcepub fn resume(self, device: &Device) -> Result<Renderer<'_>, CursorError>
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.
Sourcepub const fn has_cursor(&self) -> bool
pub const fn has_cursor(&self) -> bool
Whether a cursor is still loaded, and will be redrawn on resume.