Bug 514454 - Disabling AMS (KWIN_DRM_NO_AMS=1) breaks VRR when HDR is enabled
Summary: Disabling AMS (KWIN_DRM_NO_AMS=1) breaks VRR when HDR is enabled
Status: NEEDSINFO WAITINGFORINFO
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.5.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-11 13:41 UTC by bugreports61
Modified: 2026-01-14 17:39 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugreports61 2026-01-11 13:41:11 UTC
SUMMARY
As soon as you disable AMS in KDE with KWIN_DRM_NO_AMS=1 VRR is broken in games when HDR is active. This is not the case when HDR is not active and AMS is disabled.

This can be observed in different games, we used Cronos the new Dawn demo on steam

STEPS TO REPRODUCE
1. Install Cronos: The New Dawn demo on steam
2. Make sure KWIN_DRM_NO_AMS=1 is set for KDE and enable HDR in KDE
3. Start the game with proton experimental

OBSERVED RESULT
- VRR does not work at all

EXPECTED RESULT
- VRR works

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.19.0-rc4-273-tkg-eevdf (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 9800X3D 8-Core Processor
Memory: 48 GiB of RAM (46.6 GiB usable)
Graphics Processor: AMD Radeon RX 9070 XT

ADDITIONAL INFORMATION
- VRR works fine with AMS enabled + HDR enabled
- VRR works fine with AMS enabled + HDR disabled
- VRR works fine with AMS disabled + HDR disabled
- The issues also happens on older kernels.
- Mesa version doesn't matter, for the test i used: 25.3.3-1
- It happens when you play the game with proton experimental in xwayland and also happens if you play the game with proton-ge with winewayland.
- You do not need to enable HDR in game for the issue to show up
- We could confirm that issue also on a 7900XTX.

Many thx !
Comment 1 Zamundaaa 2026-01-12 18:09:58 UTC
The reason for this could be that KWin sets HDR metadata each frame. With legacy modesetting, setting any properties may cause the driver to do a pageflip, so if we set the property + then another frame, the driver might end up pushing two frames instead of one.

There are some workarounds we can consider, like splitting out the code path for "allow_modeset" in KWin to a separate function, but as no actual legacy drivers support HDR, maybe the best course of action would be to just remove the feature from legacy. Looking at drmdb.emersion.fr, the same applies to VRR as well.

Why are you using legacy in the first place though? It's "legacy" for a reason, it's not supposed to be used unless your driver doesn't support the proper API. I've considered ripping out the env var to force it as well...
Comment 2 bugreports61 2026-01-12 20:02:21 UTC
(In reply to Zamundaaa from comment #1)
> The reason for this could be that KWin sets HDR metadata each frame. With
> legacy modesetting, setting any properties may cause the driver to do a
> pageflip, so if we set the property + then another frame, the driver might
> end up pushing two frames instead of one.
> 
> There are some workarounds we can consider, like splitting out the code path
> for "allow_modeset" in KWin to a separate function, but as no actual legacy
> drivers support HDR, maybe the best course of action would be to just remove
> the feature from legacy. Looking at drmdb.emersion.fr, the same applies to
> VRR as well.
> 
> Why are you using legacy in the first place though? It's "legacy" for a
> reason, it's not supposed to be used unless your driver doesn't support the
> proper API. I've considered ripping out the env var to force it as well...

Hi,

many thx for taking a look !
The reason is simple, it is that one : https://gitlab.freedesktop.org/drm/amd/-/issues/2950

Disabling AMS is the only way i am not plagued by crtc timeouts.  And i am by far not the only one.

So no matter what you plan to do, please do NOT REMOVE the KWIN_DRM_NO_AMS=1 option .
I will simply go ahead and disable VRR when i enable HDR in the no ams usecase.


Many thx !
Pingubot
Comment 3 Zamundaaa 2026-01-13 20:35:02 UTC
How often does the pageflip timeout happen for you?
If it is quite frequent only with atomic modesetting, I have a pretty small patch for KWin that might just help in the same way: https://invent.kde.org/-/snippets/3643
If you can verify that it helps, maybe we should ship it upstream.
Comment 4 bugreports61 2026-01-13 21:05:38 UTC
(In reply to Zamundaaa from comment #3)
> How often does the pageflip timeout happen for you?
> If it is quite frequent only with atomic modesetting, I have a pretty small
> patch for KWin that might just help in the same way:
> https://invent.kde.org/-/snippets/3643
> If you can verify that it helps, maybe we should ship it upstream.

Hi,

its pretty random. Sometimes it happens twice or more a week, sometimes it doesn't happen for 2 weeks.

So i just need to build kwin with that patch and see if i can completely get rid of the pageflips that way ?

Many thx !
Comment 5 Zamundaaa 2026-01-13 21:53:09 UTC
Yes. My theory for the difference is that amdgpu might be missing some locks or is otherwise not handling concurrent access 100% properly, so just not accessing it from two threads at the same time could make the pageflip timeouts as rare as with legacy modesetting.
Comment 6 bugreports61 2026-01-14 17:39:26 UTC
(In reply to Zamundaaa from comment #5)
> Yes. My theory for the difference is that amdgpu might be missing some locks
> or is otherwise not handling concurrent access 100% properly, so just not
> accessing it from two threads at the same time could make the pageflip
> timeouts as rare as with legacy modesetting.

Nice, i will give it a try with plasma 6.5.5 and report back !
FYI, i never had those pageflip timeouts while gaming, it only happens during desktop usage for me.
And reading the bug report, it seems that disabling ams also helps to mitigate that issue when gnome is used.