pub struct FrameEconomy { /* private fields */ }Expand description
The per-frame present decision, and what it has decided so far.
§The point of it
The win is the skip. When nothing has changed since the last commit, the present loop issues no atomic commit at all — no flip, no reprogram. That is power saved on every panel, and on a panel capable of self-refresh it is what lets the panel stay there.
So the skip is unconditional and consults no PSR capability. Not flipping is a win whether or not the panel can self-refresh, and gating it on a capability would mean burning power on the panels that advertise nothing — which is most of them.
§Threading
Not synchronized: one present loop owns it, the same one that owns the
BufferRing.
Implementations§
Source§impl FrameEconomy
impl FrameEconomy
Sourcepub const fn decide(
&mut self,
content_changed: bool,
damage_available: bool,
) -> FrameAction
pub const fn decide( &mut self, content_changed: bool, damage_available: bool, ) -> FrameAction
Decide this frame.
content_changed is whether a layer produced a new frame or the scene
mutated since the last committed one. damage_available is whether the
producer supplied a bounded damage rectangle set, so a damaged commit is
possible at all.
The first decision after construction or force_full
is always FrameAction::CommitFull: the scanout buffer’s contents are
otherwise undefined, or a modeset has just discarded them.
Sourcepub const fn force_full(&mut self)
pub const fn force_full(&mut self)
Make the next decision a full commit.
For after a modeset, a mode change or a rebind — anything that leaves the previous scanout contents no longer applying, so damage against them would repaint the wrong difference. One-shot: it applies to the next decision and then clears.