| Summary: | Disabling AMS (KWIN_DRM_NO_AMS=1) breaks VRR when HDR is enabled | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | bugreports61 |
| Component: | wayland-generic | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | NEEDSINFO WAITINGFORINFO | ||
| Severity: | normal | CC: | xaver.hugl |
| Priority: | NOR | ||
| Version First Reported In: | 6.5.4 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
bugreports61
2026-01-11 13:41:11 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... (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 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. (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 ! 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. (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. |