Skip to content

WIP: clutter/stage-cogl: Factor in pending_swaps to next_presentation_time [performance]

Daniel van Vugt requested to merge vanvugt/mutter:schedule-later into master

get_update_time was returning -1 in some cases even if schedule_update was called prior. So the master clock was overshooting the correct update time and missing some frames. This seems to be happening most under moderate CPU load (gnome-shell#1411 (closed)), but not so high a load as to justify the frame skips that were occurring.

The reason for get_update_time returning -1 in these cases was because it was considered impossible to calculate the next update time while pending_swaps > 0. That's not completely true. We know if pending_swaps == 1 then schedule_update should schedule one frame later. So just factor pending_swaps into schedule_update. Now get_update_time won't return -1 in these cases so we're more likely to render the next frame (or move the cursor) at the correct time.

Closes: gnome-shell#1411 (closed)

Prerequisite (just FYI for backporters): !216 (merged)

Edited by Jeff Fortin

Merge request reports