Bug 480252

Summary: With Adaptive Sync enabled, fullscreen windows stop windows on other monitors from drawing
Product: [Plasma] kwin Reporter: Michael Rogers <comwizz2>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: msmafra, nate, slawek, xaver.hugl
Priority: NOR Keywords: qt6
Version First Reported In: 5.92.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Michael Rogers 2024-01-24 03:04:07 UTC
SUMMARY
Playing a game or video in full screen on a monitor can break video output on another monitor, the screen stops refreshing until I un-fullscreen the other app.
This happens across browsers and games, but notably doesn't happen if I use 2 Firefox windows on different screens.
Firefox should be running native Wayland but I am not sure the others involved are native Wayland.

STEPS TO REPRODUCE
(Other situations cause, but this is reliable)
1. Play video in firefox on screen 2 (Used youtube)
2. Play video in chrome on screen 3 (Used youtube)
3. Maximize Chrome's video.

OBSERVED RESULT
Firefox's video freezes (and sometimes becomes unresponsive to input) but the audio continues.

EXPECTED RESULT
Both videos continue playing.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Arch/RC1/updated system to be safe.
(available in About System)
KDE Plasma Version: 5.92.0
KDE Frameworks Version:  5.248.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
This has also been observed with chrome video on screen 3 and a game fullscreen on screen 2, both xWayland I believe
Comment 1 Vlad Zahorodnii 2024-01-24 12:40:22 UTC
Did you enable adaptive sync?
Comment 2 Vlad Zahorodnii 2024-01-24 12:40:46 UTC
or does your monitor support it?
Comment 3 Michael Rogers 2024-01-24 15:15:07 UTC
Yes, all monitors are identical for me (I have 3) and the main in the middle is set to automatic adaptive sync
Comment 4 Zamundaaa 2024-01-24 16:48:18 UTC
Does the problem go away if you disable adaptive sync? If that's the case then I know what's causing this
Comment 5 Michael Rogers 2024-01-24 17:48:09 UTC
It seems to go away if I set adaptive sync to never!
Comment 6 Nate Graham 2024-01-24 20:09:15 UTC
Any relation to Bug 479946?
Comment 7 Zamundaaa 2024-01-24 20:48:01 UTC
*** Bug 479946 has been marked as a duplicate of this bug. ***
Comment 8 Bug Janitor Service 2024-01-24 21:00:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5038
Comment 9 Vlad Zahorodnii 2024-01-25 08:51:33 UTC
Git commit bbc833baa64f233fa07c3b4b6e7d1eb69e9ceb29 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 25/01/2024 at 09:29.
Pushed by vladz into branch 'master'.

core/renderloop: take the output of the active window into account for vrr scheduling

If the active window is on a different output than the one the renderloop is for,
the scheduling logic would otherwise never schedule a repaint while adaptive sync
is active.

M  +1    -1    src/backends/drm/drm_abstract_output.cpp
M  +1    -1    src/backends/virtual/virtual_output.cpp
M  +1    -1    src/backends/wayland/wayland_output.cpp
M  +1    -1    src/backends/x11/standalone/x11_standalone_backend.cpp
M  +1    -1    src/backends/x11/windowed/x11_windowed_output.cpp
M  +6    -5    src/core/renderloop.cpp
M  +2    -1    src/core/renderloop.h
M  +3    -2    src/core/renderloop_p.h
M  +1    -1    src/placeholderoutput.cpp

https://invent.kde.org/plasma/kwin/-/commit/bbc833baa64f233fa07c3b4b6e7d1eb69e9ceb29
Comment 10 Vlad Zahorodnii 2024-01-25 08:58:51 UTC
Git commit 063d0ab81ae0e1b19f05bb6a4765ac20f9e75bfc by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 25/01/2024 at 09:56.
Pushed by vladz into branch 'Plasma/6.0'.

core/renderloop: take the output of the active window into account for vrr scheduling

If the active window is on a different output than the one the renderloop is for,
the scheduling logic would otherwise never schedule a repaint while adaptive sync
is active.
(cherry picked from commit bbc833baa64f233fa07c3b4b6e7d1eb69e9ceb29)

M  +1    -1    src/backends/drm/drm_abstract_output.cpp
M  +1    -1    src/backends/virtual/virtual_output.cpp
M  +1    -1    src/backends/wayland/wayland_output.cpp
M  +1    -1    src/backends/x11/standalone/x11_standalone_backend.cpp
M  +1    -1    src/backends/x11/windowed/x11_windowed_output.cpp
M  +6    -5    src/core/renderloop.cpp
M  +2    -1    src/core/renderloop.h
M  +3    -2    src/core/renderloop_p.h
M  +1    -1    src/placeholderoutput.cpp

https://invent.kde.org/plasma/kwin/-/commit/063d0ab81ae0e1b19f05bb6a4765ac20f9e75bfc
Comment 11 Vlad Zahorodnii 2024-01-29 12:34:14 UTC
*** Bug 480484 has been marked as a duplicate of this bug. ***