Skip to content

WIP: renderer-native: Accept frames without ever blocking

Daniel van Vugt requested to merge vanvugt/mutter:crtc-holds-reference into master

CRTCs now hold references to front buffer objects for the duration they are required for scanouts. This allows for automatic release of a front buffer object at exactly the right time without needing to block on explicit synchronization. So wait_for_pending_flips is now removed. In modern Vulkan terminology this new algorithm is the mailbox presentation mode and the old algorithm was FIFO mode.

Multi-monitor performance benefits the most from this change. Previously for identical monitors mutter would be blocked around 50% of the time on average (worst case 100%, best case 0%). For monitors of different frequencies the average could easily be higher than 50%. However this patch makes that figure 0% in all cases, never blocking. CPU/GPU frequency scaling should also behave better (go higher when required) now as we're no longer blocking accidentally in the wrong place and fooling the kernel into thinking we're intentionally idle.

Where previously mutter could only render at the frequency of the slowest monitor, it now renders at the frequency of the fastest. For the slower monitors they just get whatever the latest frame was according to the rate of the fastest. So we no longer starve any monitor of new frames and they are all able to update at their maximum frequencies.

Fixes: #3 (closed)

Prerequisite: !119 (merged) (it's also the first commit here)

Edited by Daniel van Vugt

Merge request reports