Bug 428729

Summary: KWin Compositor stutters after resuming it after long WINE/native gaming session.
Product: [Plasma] kwin Reporter: Samuel <sampingu02>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: major CC: lexizus
Priority: NOR    
Version: 5.20.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: 60 FPS Video showing the stutteriness of KWin Compositor after gaming

Description Samuel 2020-11-05 14:36:55 UTC
SUMMARY
KWin Compositor starts stuttering after resuming it, after long WINE/native gaming sessions (like for 30 minutes or more)

STEPS TO REPRODUCE
1. Open and Play any WINE/Native game (which triggers auto-blocking of compositing) for more than 20-30 minutes.
2. Close the game, the compositor resumes compositing.
3. Drag the cursor while pressing and holding the left mouse button on 'Desktop' to test the smoothness of highlighting box while dragging the mouse.
4. Open Firefox and scroll in any webpage (Turn on WebRender/OpenGL, Enable Smooth-scrolling and Auto-scrolling).
5. Disable Compositor (Alt+Shift+F12), Firefox scrolling and Highlight box becomes smooth again.
6. Use `killall` plasmashell & kwin_x11, then `kstart5` plasmashell & kwin_x11 to make the compositor smooth again (Not fully as smooth as before starting the game, but significantly less stutter than before).

OBSERVED RESULT
  The KWin compositor becomes stuttery after resuming the compositing after playing any game which blocks compositing for more than 20-30 minutes. This is not visually visible when dragging windows but when dragging the highlight box in desktop or when scrolling in any application like Discord, Firefox (as stated above) or even the mouse cursor visibly stutters sometimes. Disabling compositing by using the shortcut makes the desktop smooth again. Also killing and restarting kwin_x11 "almost" restores it to the initial non-stuttery state. But only logging out and logging in or restarting the machine stops this stuttering.

EXPECTED RESULT
  The KWin Compositor should resume after gaming without any stutters in desktop.

SOFTWARE/OS VERSIONS
Linux: linux-5.9.3-95-tkg-pds (Kernel doesn't make any difference)
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION
Graphics Card: GeForce GTX 1060 6GB
NVidia Proprietary Driver Version: 455.38-1 (from chaotic-AUR. Same problem with official nvidia-dkms for Linux-Zen Kernel and nvidia package in Arch official kernel)
Comment 1 Samuel 2020-11-05 14:58:45 UTC
Created attachment 133051 [details]
60 FPS Video showing the stutteriness of KWin Compositor after gaming

I can also send a higher resolution video if needed.
Comment 2 Samuel 2020-11-05 15:03:47 UTC
Also this problem occurs even if all wine applications and processes are closed. I used a script to stop all wine processes, no use, still stutters. Occurs in Native games too like Shadow/ Rise of the Tomb Raider and Tomb Raider.
Comment 3 alex 2021-01-13 17:21:23 UTC
I confirm there is a bug. After exiting the game (Port or DXVK) Plasma starts to "stutter". The effects are preserved but smoothness is lost. To reproduce the bug, I need to play for a while, there is no time binding, you can start and close the game and it will appear.
Msi Gtx 770
Driver 455 nvidia
Kde 5.20.4
Comment 4 Vlad Zahorodnii 2021-01-14 07:26:03 UTC

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