Skip to content

wayland: Emit frame events in GSource after "empty" updates

Robert Mader requested to merge rmader/mutter:frame-clock-skip-interval into main

From the main commit:

Under certain conditions a stage-view update does not trigger a kms
update.

In such cases we still want the next update to run within the same
refresh cycle, as otherwise we'd waste the remaining time in the
current one.
At the same time we currently use the `after-update` signal for Wayland
frame events, which again may result in more "empty" updates -
creating an unthrottled feedback loop. This can trigger excessive
load both in the compositor as well as in clients.

Introduce a new GSource that is dispatched once per refresh cycle at
maximum per stage view and use it to emit frame events. Do so by
computing the time from when on we can be sure that an update resulting
from a client commit would certainly get scheduled to the next refresh
cycle.

Related:

cc @daenzer @jadahl @doraskayo @vanvugt

Edited by Robert Mader

Merge request reports