Skip to content

Wayland: Handle fifo_v1 and clean up suspension logic#101454

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
deralmas:fifo_ftw
Apr 25, 2025
Merged

Wayland: Handle fifo_v1 and clean up suspension logic#101454
Repiteo merged 1 commit intogodotengine:masterfrom
deralmas:fifo_ftw

Conversation

@deralmas
Copy link
Copy Markdown
Contributor

@deralmas deralmas commented Jan 11, 2025

Before, the WSI was unfortunately quite broken and we had work around it by manually pacing frames. Needless to say it was not an ideal solution.

Now, the WSI can make use of the new fifo_v1 protocol to work properly. If it's available, we'll trust the WSI by disabling manual frame pacing.

While we're at it, let's clean up the suspension code a bit by removing some duplicated stuff and handling the suspension state through a switch case.


Note that fifo_v1 seems to be only used by the Vulkan WSI and not mesa's EGL implementation. For the time being the opengl backend will always manually throttle frames. I only found out about this while writing this PR.

As usual with this part of the backend, we need thorough testing for every combination. I did my best to try every compositor I could find but regular use with stuff like LSPs would be better.

Note that to try this new protocol you're going to need mesa starting from commit 63cbbf2a1c80742a4485417d984b1426b5262ac7 and one of the following:

There's also a WIP wlroots implementation but I had issues during my initial tests a month or two ago. If you want to play around with it it's over at MR !4463

Before, the WSI was unfortunately quite broken and we had work around it
by manually pacing frames. Needless to say it was not an ideal solution.

Now, the WSI can make use of the new fifo_v1 protocol to work properly.
If it's available, we'll trust the WSI by disabling manual frame pacing.

While we're at it, let's clean up the suspension code a bit by removing
some duplicated stuff and handling the suspension state through a switch
case.
@akien-mga akien-mga changed the title Wayland: Handle fifo_v1 and clean up suspension logic Wayland: Handle fifo_v1 and clean up suspension logic Apr 24, 2025
Copy link
Copy Markdown
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me.

I can't test yet easily as I'm mainly on KDE Plasma, and the latest stable release in Fedora 42 doesn't have the fifo_v1 implementation yet.

It seems to be slated for Plasma 6.4.0 which will be released mid June: https://community.kde.org/Schedules/Plasma_6#Future_releases

The implementation looks like we still use the same vsync emulation logic if FIFO is not available so it shouldn't cause issues for current users.

@akien-mga akien-mga modified the milestones: 4.x, 4.5 Apr 24, 2025
@Repiteo Repiteo merged commit 041c69d into godotengine:master Apr 25, 2025
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Apr 25, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants