Expand description
The present spine: getting rendered frames onto a display, repeatedly.
Port of src/present/ from drm-cxx @ 4a0b64a, less the GPU producers.
Where drmkit_scene answers “what goes on
which plane this frame”, this crate answers the questions around it: which
buffer to draw into, how much of it needs redrawing, and whether the frame
is worth submitting at all.
§Why it is a separate crate
A producer that renders on the GPU needs EGL or Vulkan; one that writes pixels with the CPU needs neither. Keeping the spine core-only means a GPU-less build — a kiosk, a test rig, an instrument panel — links no graphics stack at all. The producers that do live in their own crates and load their libraries at runtime.
§Not here yet
Being built up. BufferRing, negotiate and FrameEconomy are in;
ScanoutBackend, DumbScanoutSink and DumbRingSource follow, and the
GBM, GL and Vulkan producers are separate crates after that.
Structs§
- Backend
Config - How to build a scanout backend.
- Buffer
Ring - A producer-agnostic pool of scanout slots with buffer age and damage accumulation.
- Config
- How a sink is configured.
- Dumb
Ring Source - A ring of CPU-mapped dumb buffers, presented as a scene layer’s source.
- Dumb
Scanout Sink - A software present path: hand it a finished CPU frame, it puts it on screen.
- Frame
Economy - The per-frame present decision, and what it has decided so far.
- GbmScanout
Producer - Allocates scanout buffers straight from the DRM node’s GBM device.
- Lease
- A slot handed to the producer for the next frame.
- Rect
- A damage rectangle, in buffer pixels.
- Scanout
Backend - One output, one layer, and everything between a producer and the screen.
Enums§
- Frame
Action - What the present loop should do with this frame.
- Paint
Error - What went wrong painting a frame.
- Present
Error - What went wrong presenting a frame.
- Producer
Error - Why a producer could not hand over a buffer.
- Repaint
- What a reused slot must repaint before its contents are a correct frame.
- Restore
Policy - What to leave on screen when the backend goes away.
- VrrPolicy
- When to ask for variable refresh.
Constants§
- DEFAULT_
PREFERENCE - The default preference order: most colour depth first, 16-bit last.
Traits§
- Scanout
Producer - Something that allocates the buffers a scanout path presents.
Functions§
- negotiate
- Intersect what a producer can export with what a plane can scan out, and rank the survivors.
- negotiate_
for_ format - As
negotiate, taking the plane’s modifiers from aFormatTablefor onefourcc. - negotiate_
scanout_ format - The first format in
preferredthat a plane oncrtc_idcan scan out.