Skip to content

KMS: Lookup pending updates by MetaKmsCrtc instead of MetaKmsDevice

Daniel van Vugt requested to merge vanvugt/mutter:find-update-by-crtc into main

For mode setting we want all CRTCs to share the same MetaKmsUpdate, but after that we don't want them to share the same update for regular flips and cursor movement. The reason being that different CRTCs are attached to different displays with different clocks. So each CRTC would finish the same update at slightly different times.

If you wait for all CRTCs to complete a shared update then you have waited half a frame on average, possibly more. This waiting would consume most of the render time for the next frame and risk stuttering.

If you only wait for one CRTC to complete a shared update then the next shared update may be posted before other CRTCs have finished the last, so the next update would fail due to those other CRTCs still being busy.

So the only safe answer for maintaining full framerate of multiple outputs is to ensure unsynchronized CRTCs don't share the same update. At least not after mode setting.

This fixes a latent bug blocking !1441 (comment 1265504) whereby meta_onscreen_native_finish_frame would fail its post because it was trying to commit a cursor update on the wrong (busy) CRTC.

Edited by Daniel van Vugt

Merge request reports