Bug 499176 - kwin_wayland ignores the host compositor's refresh rate
Summary: kwin_wayland ignores the host compositor's refresh rate
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-wayland-nested (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-27 00:53 UTC by karldfeacd
Modified: 2025-01-29 23:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description karldfeacd 2025-01-27 00:53:03 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
When running a nested kwin_wayland compositor the nested compositor defaults to running at 60hz. There is no option in kwin_wayland to override this default.

This is problematic as applications running inside of a nested flicker heavily when the kwin_wayland window is on a higher refresh rate monitor. The issue does not occur when the window is on a 60hz monitor nor does it happen when the application inside of kwin_wayland is ran directly on the hosts wayland socket.


STEPS TO REPRODUCE
1. Start kwin_wayland
2. stats applications inside the kwin_wayland window

OBSERVED RESULT
kwin_wayland runs at 60hz confirmed by kscreen-doctor -o

EXPECTED RESULT
kwin_wayland should run at the refresh rate of the display


SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Linux 6.12.10-zen
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2025-01-28 17:29:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7076
Comment 2 Zamundaaa 2025-01-28 20:52:18 UTC
Git commit c912767c4872755c3bbf72e04eb1c17c72608120 by Xaver Hugl.
Committed on 28/01/2025 at 20:40.
Pushed by zamundaaa into branch 'master'.

backends/wayland: use presentation time to track presentation of commits

This means we get the correct refresh rate from the host compositor, and we also get
accurate feedback about when and if the frame we pushed was presented.

M  +11   -0    src/backends/wayland/wayland_display.cpp
M  +3    -0    src/backends/wayland/wayland_display.h
M  +79   -4    src/backends/wayland/wayland_output.cpp
M  +6    -0    src/backends/wayland/wayland_output.h

https://invent.kde.org/plasma/kwin/-/commit/c912767c4872755c3bbf72e04eb1c17c72608120
Comment 3 Zamundaaa 2025-01-28 21:34:15 UTC
Git commit 3ce7452423237a9b77fdaf8ba5adea44ea640cfd by Xaver Hugl.
Committed on 28/01/2025 at 21:20.
Pushed by zamundaaa into branch 'Plasma/6.3'.

backends/wayland: use presentation time to track presentation of commits

This means we get the correct refresh rate from the host compositor, and we also get
accurate feedback about when and if the frame we pushed was presented.
(cherry picked from commit c912767c4872755c3bbf72e04eb1c17c72608120)

M  +11   -0    src/backends/wayland/wayland_display.cpp
M  +3    -0    src/backends/wayland/wayland_display.h
M  +79   -4    src/backends/wayland/wayland_output.cpp
M  +6    -0    src/backends/wayland/wayland_output.h

https://invent.kde.org/plasma/kwin/-/commit/3ce7452423237a9b77fdaf8ba5adea44ea640cfd