Summary: | Framerate Doubling in Bursts when mirroring screens | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Jake <jake> |
Component: | multi-screen | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jake, nate, xaver.hugl |
Priority: | NOR | Keywords: | multiscreen |
Version First Reported In: | 6.2.5 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/kwin/-/commit/dc3f798e74b5b049c1506246fa37e2751052565c | Version Fixed In: | 6.3.6 |
Sentry Crash Report: |
Description
Jake
2025-01-13 22:16:28 UTC
I'm not sure why this would come in bursts, but the issue is likely that we send frame callbacks for every time KWin renders the window, on any output. If we restrict that to only send frame callbacks for one output, then the problem should go away. A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7713 Git commit 8424bf88b67800c3d22384022e60c08d26e50ea4 by Xaver Hugl. Committed on 03/06/2025 at 11:10. Pushed by zamundaaa into branch 'master'. scene/item: restrict frame callbacks based on the output rather than geometry Sending frame callbacks based on whether or not the bounding rect intersects with the rendered output has two big problems: - when a window is entirely off-screen, it never gets frame callbacks. This is particularly problematic when the application waits for frame callbacks to render the next frame, but KWin waits with moving them to an output until the application commits the surface - when a window is on two outputs at once (like with cloning), then it gets twice the amount of frame callbacks - which means the application ends up rendering twice as fast, which doesn't make any sense This commit replaces that approach with just checking if the output is the same as the one Workspace picks for the center of the window. If the window is entirely off-screen, that will still result in an output getting chosen, and it also can't be on two outputs at once. Related: bug 479694, bug 505060 M +2 -1 src/scene/item.cpp M +2 -3 src/scene/item.h M +9 -0 src/scene/rootitem.cpp M +2 -0 src/scene/rootitem.h https://invent.kde.org/plasma/kwin/-/commit/8424bf88b67800c3d22384022e60c08d26e50ea4 Git commit ada3f238db01027b7100afe60868f75b64828018 by Xaver Hugl. Committed on 03/06/2025 at 12:04. Pushed by zamundaaa into branch 'Plasma/6.4'. scene/item: restrict frame callbacks based on the output rather than geometry Sending frame callbacks based on whether or not the bounding rect intersects with the rendered output has two big problems: - when a window is entirely off-screen, it never gets frame callbacks. This is particularly problematic when the application waits for frame callbacks to render the next frame, but KWin waits with moving them to an output until the application commits the surface - when a window is on two outputs at once (like with cloning), then it gets twice the amount of frame callbacks - which means the application ends up rendering twice as fast, which doesn't make any sense This commit replaces that approach with just checking if the output is the same as the one Workspace picks for the center of the window. If the window is entirely off-screen, that will still result in an output getting chosen, and it also can't be on two outputs at once. Related: bug 479694, bug 505060 (cherry picked from commit 8424bf88b67800c3d22384022e60c08d26e50ea4) M +2 -1 src/scene/item.cpp M +2 -3 src/scene/item.h M +9 -0 src/scene/rootitem.cpp M +2 -0 src/scene/rootitem.h https://invent.kde.org/plasma/kwin/-/commit/ada3f238db01027b7100afe60868f75b64828018 Git commit dc3f798e74b5b049c1506246fa37e2751052565c by Xaver Hugl. Committed on 03/06/2025 at 12:08. Pushed by zamundaaa into branch 'Plasma/6.3'. scene/workspacescene: restrict frame callbacks based on the output rather than geometry Sending frame callbacks based on whether or not the bounding rect intersects with the rendered output has two big problems: - when a window is entirely off-screen, it never gets frame callbacks. This is particularly problematic when the application waits for frame callbacks to render the next frame, but KWin waits with moving them to an output until the application commits the surface - when a window is on two outputs at once (like with cloning), then it gets twice the amount of frame callbacks - which means the application ends up rendering twice as fast, which doesn't make any sense This commit replaces that approach with just checking if the output is the same as the one Workspace picks for the center of the window. If the window is entirely off-screen, that will still result in an output getting chosen, and it also can't be on two outputs at once. Related: bug 479694, bug 505060 (cherry picked from commit 8424bf88b67800c3d22384022e60c08d26e50ea4) M +1 -1 src/scene/workspacescene.cpp https://invent.kde.org/plasma/kwin/-/commit/dc3f798e74b5b049c1506246fa37e2751052565c |