Bug 485639 - Adaptive Sync has inconsistent refresh in KWin Plasma/6.0 (AMDGPU)
Summary: Adaptive Sync has inconsistent refresh in KWin Plasma/6.0 (AMDGPU)
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.0.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-16 16:41 UTC by Pedro Nishiyama
Modified: 2024-04-21 15:12 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Nishiyama 2024-04-16 16:41:42 UTC
SUMMARY

This problem has already been fixed on master with:

https://invent.kde.org/plasma/kwin/-/commit/656313455bb4ea95a10f20681189db85cc18f555
https://invent.kde.org/plasma/kwin/-/commit/4448e23363556615615fd307dfddf021a6b69b27

STEPS TO REPRODUCE
1. Open a game. (Easier to reproduce in 3d games)
2. Set 60 FPS cap.
3. If possible check your monitor refresh OSD.

OBSERVED RESULT
The refresh rate is all over the place.

EXPECTED RESULT
The refresh rate should be at 60hz.
Comment 1 Oleh 2024-04-17 15:08:03 UTC
The same issue after updating to 6.0.4 today. VRR stopped working in all Proton\Wine games, it constantly jumps from 75hz to max refresh rate (180hz) and vice versa
Comment 2 Ivan Ko 2024-04-19 14:32:39 UTC
Can confirm that 6.0.4 is the issue. Tried to patch stable 6.0.4 with those commits (required some changes) and that didn't fix anything. Rebuilding kwin 6.0.3 package fixes framerate and games are butter smooth again.
Comment 3 Ivan Ko 2024-04-19 16:15:36 UTC
Reverting the following commit from 6.0.4 branch fixes the issue for me:

https://invent.kde.org/plasma/kwin/-/commit/19ffe2ac411b866cd646942d4e3cfb41d8ca89a1
Comment 4 tux 2024-04-19 18:12:35 UTC
(In reply to Ivan Ko from comment #3)
> Reverting the following commit from 6.0.4 branch fixes the issue for me:
> 
> https://invent.kde.org/plasma/kwin/-/commit/
> 19ffe2ac411b866cd646942d4e3cfb41d8ca89a1

Thanks, I can confirm that reverting that commit fixes it for me too! Both VRR disabled and enabled work without stuttering for me now.
Comment 5 Bug Janitor Service 2024-04-19 21:18:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5626
Comment 6 Pedro Nishiyama 2024-04-19 23:22:49 UTC
(In reply to Bug Janitor Service from comment #5)
> A possibly relevant merge request was started @
> https://invent.kde.org/plasma/kwin/-/merge_requests/5626

Fixed the issue.
Comment 7 Pedro Nishiyama 2024-04-20 07:34:00 UTC
I managed to reproduced the issue, when the PC goes to sleep mode and come back, the VRR starts to refresh inconsistently. It occurs mainly at lower framerates, such as 60~90 FPS, even with consistent frametimes.
The commits I listed do nothing in this case.
Comment 8 Ivan Ko 2024-04-20 11:03:56 UTC
(In reply to Bug Janitor Service from comment #5)
> A possibly relevant merge request was started @
> https://invent.kde.org/plasma/kwin/-/merge_requests/5626

Confirmed issue was fixed.
Comment 9 Zamundaaa 2024-04-21 14:55:00 UTC
Git commit fba948b39f6e3b2e70caa1880903f8fb17faf6d9 by Xaver Hugl.
Committed on 19/04/2024 at 21:06.
Pushed by zamundaaa into branch 'master'.

scene/workspacescene: don't check direct scanout candidates for a pixmap

We don't need a pixmap for direct scanout, and the drm backend destroys the pixmap
when direct scanout is successful... so this check created a loop of direct scanout
working and not working, and worse, the client reallocating its buffers each time.
Related: bug 485730, bug 485712, bug 477016

M  +1    -11   src/scene/workspacescene.cpp

https://invent.kde.org/plasma/kwin/-/commit/fba948b39f6e3b2e70caa1880903f8fb17faf6d9
Comment 10 Zamundaaa 2024-04-21 15:12:02 UTC
Git commit fbd780186c76764617dba0365b9ca3de7cfe2f86 by Xaver Hugl.
Committed on 21/04/2024 at 14:55.
Pushed by zamundaaa into branch 'Plasma/6.0'.

scene/workspacescene: don't check direct scanout candidates for a pixmap

We don't need a pixmap for direct scanout, and the drm backend destroys the pixmap
when direct scanout is successful... so this check created a loop of direct scanout
working and not working, and worse, the client reallocating its buffers each time.
Related: bug 485730, bug 485712, bug 477016


(cherry picked from commit fba948b39f6e3b2e70caa1880903f8fb17faf6d9)

M  +1    -11   src/scene/workspacescene.cpp

https://invent.kde.org/plasma/kwin/-/commit/fbd780186c76764617dba0365b9ca3de7cfe2f86