Skip to content

backends/native: Make await_flush later and inlined

Daniel van Vugt requested to merge vanvugt/mutter:optimize-await-flush into main

"Later" as in after GL is finished rendering so as to not block the deadline timer from updating the cursor smoothly during long GL renders. Indeed this could make a primary plane frame late in some cases but that's only when going from idle to active, so there is no previous frame to observe stutter within the primary plane.

"Inlined" as in we don't need most of meta_kms_device_await_flush. The important part is that it calls disarm_crtc_frame_deadline_timer to avoid attempting two posts at once. So that's all that is kept.

This also fixes a deadlock in triple buffering. By not cancelling the cursor update during a GL render we're also not cancelling a primary plane update that might have already been piggybacked onto it by queue_update.

Since the old meta_kms_device_await_flush is now unused we are able to remove more surrounding code.

Edited by Daniel van Vugt

Merge request reports