SDL Developers Weigh Reverting Wayland Over X11 For SDL 3.0

Written by Michael Larabel in Linux Gaming on 26 March 2024 at 11:27 AM EDT. 106 Comments
LINUX GAMING
With the SDL library that's widely-used by cross-platform games with the current SDL 3.0 development code it prefers Wayland over X11, but a new pull request would temporarily revert that on the basis of the Wayland ecosystem still not being up to par.

Two years ago after trying for Wayland support by default, SDL reverted the change due to bugs / ecosystem issues. With the big in-development SDL 3.0 release, it's trying again to prefer Wayland over X11 but this weekend a new pull request was opened that would revert that Wayland preference.

Joshua Ashton with Valve's Linux graphics team opened the pull request that would revert the preferring of Wayland over X11. Ashton argues in the merge request:
"Wayland has a myriad of unresolved problems regarding surface suspension blocking presentation and the FIFO (vsync) implementation being fundamentally broken leading to reduced GPU-bound performance.

That is not to say "we should fix FIFO in Mesa/other drivers," but rather that it is completely unfixable without an additional protocol, in this case fifo-v1.

Without this protocol, vkQueuePresent or glSwapBuffers must stall for the 'frame' callback after presenting an image. The only reason we can get away with this on SteamOS is because Gamescope implements what is essentially fifo-v1 and we use that there.

The other side is surface suspension -- a very similar issue to the above wrt the frame callback being used in that way and blocking. If the SDL window is obscured, vkQueuePresent will block in FIFO, which games typically do NOT like. This is solved by the combination of fifo-v1 and commit-timing-v1.

There is no advantage to games and average applications preferring Wayland over X11 -- only severe performance and unusability regressions right now. Thus, we must revert this change until fifo-v1 and commit-timing-v1 are released and at least in a stable release for major compositors."

That matter is now being hotly debated inside the pull request with some arguing the advantages for games on Wayland. There's also some suggestions that the fifo-v1 and commit-timing-v1 protocols should be checked for in deciding the Wayland support as opposed to a complete revert.

SDL revert


For now that pull request hasn't been merged but it looks like that a revert or partial disabling might happen for SDL 3.0 at least until the FIFO and Commit Timing protocols are finalized upstream and seeing Wayland compositor support. This possible revert comes just days after the SDL 3.0 preview release. The discussion is ongoing, stay tuned.

Update: SDL3 Will Keep Wayland Default At Least For The Time Being
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