Bug 500754 - Plasma 6: Half the FPS with atomic mode setting (again)
Summary: Plasma 6: Half the FPS with atomic mode setting (again)
Status: RESOLVED DUPLICATE of bug 500219
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (other bugs)
Version First Reported In: 6.3.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression, wayland-only
Depends on:
Blocks:
 
Reported: 2025-02-25 22:43 UTC by Celeste Wouters
Modified: 2025-02-28 13:45 UTC (History)
4 users (show)

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


Attachments
kwin info (6.37 KB, text/plain)
2025-02-25 22:43 UTC, Celeste Wouters
Details
Trine 1 (enchanted edition) from Steam with MangoHUD's frame time visible (2.92 MB, image/png)
2025-02-28 10:33 UTC, John
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Celeste Wouters 2025-02-25 22:43:25 UTC
Created attachment 178884 [details]
kwin info

SUMMARY
It seems Bug 476860 has reared its ugly head again.
When running Plasma 6 Wayland session on my Intel Arc B580 system, I get half the FPS (30 instead of 60, 60 instead of 120).

STEPS TO REPRODUCE
0. Optional: Change GPU from AMD to Intel Arc, with a config previously at 120 Hz.
1. Login in to a Plasma 6 Wayland session
2. Notice half the framerate immediately

OBSERVED RESULT
The screen's (DP) signal is driven at the desired Hz, but only every other frame is actually drawn.
Unlike Bug 476860, the "Show FPS" desktop effect does NOT accurately represent the frame rate being half of desired, instead stating an FPS as if the output worked correctly.

EXPECTED RESULT
Chosen target refresh rate.

SOFTWARE/OS VERSIONS
Operating System: Void Linux
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.4 (64-bit)
Graphics Platform: Wayland
Processors: Ryzen 7 5800X
Memory: 32 GiB of RAM
Graphics Processor: Intel Arc B580, with Xe driver

ADDITIONAL INFORMATION
In my setup the B580 runs using the Xe driver, not i915, which is (probably) why the previous fix checking for i915 fails to work here: https://invent.kde.org/plasma/kwin/-/commit/869e86ff0014e020c4076a8f22e78f69cab1063a#91b544134e3706774df2d5108043b8f8cef97fc9_78_78 .
Most likely Xe exhibits the same behaviour and needs the same bypass.
Just as with the previous bug, this is fixed temporarily by setting `KWIN_DRM_NO_AMS=1`.
Comment 1 Bug Janitor Service 2025-02-25 23:33:37 UTC
Thank you for the bug report!

Please note that Plasma 6.2.5 will not be supported for much longer by KDE; supported versions are 5.27., and 6.3 or newer.

Please upgrade to the latest version as soon as your distribution makes it available to you. Plasma is a fast-moving project, and bugs in one version are often fixed in the next one.
Comment 2 Nate Graham 2025-02-26 20:01:28 UTC
Any chance you can upgrade to Plasma 6.3 and try again?
Comment 3 Morice Olbert 2025-02-26 20:24:51 UTC
Same problem on Plasma 6.3.2.
Comment 4 Zamundaaa 2025-02-27 17:52:28 UTC
Maybe the xe driver has the same problem, but let's check to be sure. If you put KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS=1 into /etc/environment and reboot, does that fix it?
Comment 5 Celeste Wouters 2025-02-27 20:16:18 UTC
No, KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS=1 does not fix it.
So it's something else related to AMS itself or being enabled alongside it.
Comment 6 Celeste Wouters 2025-02-27 20:33:03 UTC
Neither does setting KWIN_DRM_DISABLE_TRIPLE_BUFFERING or KWIN_DRM_NO_DIRECT_SCANOUT for that matter.
Atomic Mode Setting works just fine in other compositors like Sway or Weston.
Comment 7 John 2025-02-28 10:29:11 UTC
I'm not sure, but I think I have the same problem here, on Debian 13 (Trixie) - unstable repository, with:

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.11.0
Qt Version: 6.7.2
Kernel Version: 6.12.16-amd64 (64-bit)
Mesa  Version: 25.0.0-1
Graphics Platform: Wayland

HARDWARE SPECIFICATIONS
Hardware: Laptop Dell Inspiron 5770 (17" 1080p@60Hz screen)
CPU: Intel® Core™ i5-8250U CPU @ 1.60GHz
GPU 1: Mesa Intel® UHD Graphics 620 (main, Vulkan capable)
GPU 2: AMD Radeon R5 M465 Series
RAM: 8 GiB (7.7 GiB usable)

kscreen-doctor -o shows this:
Output: 1 eDP-1
        enabled
        connected
        priority 1
        Panel
        Modes:  1:1920x1080@60*!  2:1920x1080@48  3:1280x1024@60  4:1024x768@60  5:1280x800@60  6:1920x1080@60  7:1600x900@60  8:1368x768@60  9:1280x720@60 
        Geometry: 0,0 1477x831
        Scale: 1.3
        Rotation: 1
        Overscan: 0
        Vrr: incapable
        RgbRange: Full
        HDR: incapable
        Wide Color Gamut: incapable
        ICC profile: none
        Color profile source: EDID
        Color power preference: prefer efficiency and performance
        Brightness control: supported, set to 97% and dimming to 100%



I tried all the environment variables discussed here:
export KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS=1
export KWIN_DRM_DISABLE_TRIPLE_BUFFERING=1
export KWIN_DRM_NO_DIRECT_SCANOUT=1

And even some found in other places, that seem to improve Plasma a bit:
export QSG_RHI_BACKEND=vulkan
export QSG_RENDER_LOOP=threaded

But nothing works!

I noticed that a few old games in Steam, like Trine 1 (enchanted edition) and Trine 2: complete story:
https://store.steampowered.com/bundle/12294/Trine_Ultimate_Collection/
Are running pretty bad compared to before, with very low FPS and an insane amount of stuttering, like every 1-2 seconds
So, besides the already installed Steam client from Flathub (com.valvesoftware.Steam), i also installed MangoHUD from Flathub
(org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/24.08) and configured it a bit to show me only things I cared about and what I thought would help me find the cause of that huge stuttering that makes the FPS continuously drop from  30-40 something to 14-18 FPS.

At first I thought that it's again the stupid Steam client that it's trying again to use the dedicated GPU, that is not faster than the integrated one and also doesn't support Vulkan at all, so I scoured the internet until I found how to properly force Steam to use the integrated one that supports Vulkan so DXVK works and I combined it with the MangoHUD configuration enabling like this:
flatpak override --filesystem=xdg-config/MangoHud:ro --env=DXVK_FILTER_DEVICE_NAME="Intel(R) UHD Graphics 620 (KBL GT2)" com.valvesoftware.Steam
And it worked for making Steam use the GPU with better capabilities / drivers...

But the situation didn't improve and the FPS continues to jump up and down every 1-2 seconds!
Have a look at print screen on the frame time graph!
Comment 8 John 2025-02-28 10:33:13 UTC
Created attachment 178968 [details]
Trine 1 (enchanted edition) from Steam with MangoHUD's frame time visible
Comment 9 Celeste Wouters 2025-02-28 12:07:33 UTC
John's issue is probably a different one, as mine exhibits a very stable framerate (half of what's reported by Kwin and applications/games) irrespective of render load, and no slowdowns or stutter. Even the cursor DRM plane is affected, and in fact is what is most visible immediately after starting kwin/Plasma up.
Comment 10 Zamundaaa 2025-02-28 13:44:36 UTC
Yeah, please make a separate bug report about that.

(In reply to Celeste Wouters from comment #5)
> No, KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS=1 does not fix it.
> So it's something else related to AMS itself or being enabled alongside it.
Okay, then I'm confident this is https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4363. We commit closer to vblank than other compositors to get low latency, so if the driver takes ages (1.5ms and up) to apply the commit, it drops every second screen update.
Comment 11 Zamundaaa 2025-02-28 13:45:01 UTC

*** This bug has been marked as a duplicate of bug 500219 ***