Frog-FIFO-V1 Aims To Address Mesa's "Fundamentally Broken" Wayland Code

Written by Michael Larabel in Mesa on 25 September 2024 at 01:00 AM EDT. 70 Comments
MESA
Joshua Ashton of Valve's Linux graphics team has opened a Mesa merge request to support a proposed "frog-fifo-v1" protocol for Wayland to address the matter of "FIFO is fundamentally broken under Mesa's Wayland WSI right now."

Joshua Ashton's new merge request is to adapt the Mesa Vulkan WSI Wayland code to support this "frog-fifo-v1" protocol. The areas where the Mesa Wayland WSI code is deemed "fundamentally broken" right now pertain to swapchain starvation and applications using FIFO stall when occluded.

Ashton argues in the merge request:
"These not just small edgecases, these are huge gaping issues, that block eg. SDL from picking Wayland by default (https://github.com/libsdl-org/SDL/pull/9383). It is time to finally do something about these problems and begin to unblock this functionality for users.

Notably, we have been shipping essentially this functionality in SteamOS/Gamescope since 3.5 when we moved to using the Wayland WSI, but implementing this in our own Gamescope WSI layer, as the GPU starvation of the FIFO implementation right now, hits really hard in this performance and power envelope. It is a serious and genuine problem.

FIFO been broken like this since the entire lifetime of the Mesa Wayland WSI, and attempts have gone back multiple years to fix either problem 1 or 2, but none have landed, and users who want better GPU-bound performance and their games to not freeze and disconnect them when occluded have been forced to use X11/XWayland.

We need to fix this, and it has been far too long. Having an implementation landed and able to be used by regular users, will not only be beneficial for the users, but can help prove the solution in the real world, and also find any problems that might arise with an upstream variant. This is all voluntary and opt-in by compositors that expose the frog-fifo-v1 protocol."

As part of this is establishing frog-protocols as an alternative to the Wayland-Protocols de facto upstream repository for new Wayland protocols. Frog Protocols describes itself and its objectives as:
"Wayland Protocols has long had a problem with new protocols sitting for months, to years at a time for even basic functionality.

This is hugely problematic when some protocols implement very primitive and basic functionality such as frog-fifo-v1, which is needed for VSync to not cause GPU starvation under Wayland and also fix the dreaded application freezing when windows are occluded with FIFO/VSync enabled.

We need to get protocols into end-users hands quicker! The main reason many users are still using X11 is because of missing functionality that we can be shipping today, but is blocked for one reason or another."

I whole-heartedly agree with this Frog Protocols effort at least until upstream Wayland Protocols is able to act in a more punctual manner. There indeed have been many protocols stalled for months/years at a time under the current workflow. Count me in.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week