1
0
Fork 0
mutter-performance-source/doc/clutter-frame-scheduling.md
Dor Askayo 82cdf90a71 clutter/frame-clock: Add a state for when scheduled "now"
The new CLUTTER_FRAME_CLOCK_STATE_SCHEDULED_NOW state is almost
identical to CLUTTER_FRAME_CLOCK_STATE_SCHEDULED, with one important
difference being that it avoids updates from being repeatedly
rescheduled "now" when multiple calls to
clutter_frame_clock_schedule_update_now() are done before the source
is actually dispatched.

Such repeated calls to schedule an update "now" may actually postpone
the dispatch if the CPU is very busy and the source dispatch is
delayed, defeating the purpose of scheduling a frame "now".

It also allows rescheduling "now" when the frame clock is uninhibited
after being inhibited while an update was scheduled "now". This may
be important in cases where the frame clock is inhibited for very
short periods in which it would otherwise lose the state of being
scheduled "now".

Scenarios such as this would become more common with the introduction
of variable refresh rate since it makes scheduling "now" a commonplace
occurrence.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3561>
2024-02-10 16:16:19 +00:00

537 B

Clutter Frame scheduling

ClutterFrameClock state diagram.

stateDiagram
    Init --> Scheduled/ScheduledNow : schedule update() -> now
    Idle --> Scheduled/ScheduledNow : schedule update() -> given presentation time
    Scheduled/ScheduledNow --> Dispatching : target time hit
    Dispatching --> PendingPresented : queued page flip
    Dispatching --> Idle : no queued page flip
    PendingPresented --> Scheduled/ScheduledNow : page flipped, if recent schedule update
    PendingPresented --> Idle : page flipped