Bug 494675

Summary: Screen tearing and lag when moving windows diagonally
Product: [Plasma] kwin Reporter: Antonio <antonio.tigri>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: NEEDSINFO WAITINGFORINFO    
Severity: normal CC: mapatrapa, xaver.hugl
Priority: NOR    
Version: 6.2.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Antonio 2024-10-13 15:38:15 UTC
SUMMARY
After updating to KDE Plasma 6.2, started experiencing tearing and lagginess issues when moving/dragging windows around.

STEPS TO REPRODUCE
1. Drag a window diagonally (any angle should reproduce the problem).

OBSERVED RESULT
Window tears and doesn't move smoothly (with a low framerate).


EXPECTED RESULT
Same or similar smoothnes than when windows are dragged strictly vertically/horizontally


SOFTWARE/OS VERSIONS
Linux: Linux 6.11.3-zen1-1-zen
KDE Plasma Version: 6.2
Qt Version: 6.7.3-2

ADDITIONAL INFORMATION
using wayland
using optimus manager to only use dedicated gpu (nvidia)
nvidia-drm module loaded and parameters active
nvidia module loaded and EnableGpuFirmware=0
Reproduced with a laptop + 2 external monitors setup. Never reproduced in laptop screen. For the external monitors, sometimes happens on both, sometimes happens in only one.
Comment 1 Jesus 2024-10-13 19:50:39 UTC
Confirmed, the same thing happens to me with an nvidia graphics card as well. The problem disappears if I have any window maximized on a virtual desktop, if I move another window over the maximized one everything works smoothly.
Comment 2 Zamundaaa 2024-10-13 21:10:47 UTC

*** This bug has been marked as a duplicate of bug 494547 ***
Comment 3 Antonio 2024-10-15 20:11:38 UTC
(In reply to Zamundaaa from comment #2)
> 
> *** This bug has been marked as a duplicate of bug 494547 ***

Mine is not an issue of artifacts or flickering, and changing that environment variable does not resolve the issue either. The problem is specifically slowness when moving windows diagonally or shaking the mouse when it becomes big (also diagonally).

Current version is  6.2.0-2 so I am not sure if it is actually related to 494547 and the problem is that arch does not have that update yet, but nothing changed from 6.2.0-1
Comment 4 Zamundaaa 2024-10-23 14:33:10 UTC
okay, it might still come down to a similar driver issue though - synchronization being broken with multi gpu copies.
Comment 5 Bug Janitor Service 2024-10-23 14:39:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6690
Comment 6 Zamundaaa 2024-10-23 15:10:38 UTC
Git commit 06a08004dc454b2a83e395922a55721416f10563 by Xaver Hugl.
Committed on 23/10/2024 at 14:39.
Pushed by zamundaaa into branch 'Plasma/6.2'.

backends/drm: add an environment variable to force glFinish on multi gpu copies

Mostly useful for debugging multi gpu glitches

M  +4    -2    src/backends/drm/drm_egl_layer_surface.cpp

https://invent.kde.org/plasma/kwin/-/commit/06a08004dc454b2a83e395922a55721416f10563
Comment 7 Zamundaaa 2024-10-23 15:19:40 UTC
If you can compile the Plasma/6.2 branch yourself, or once 6.2.3 is out with that commit, please test with the KWIN_DRM_FORCE_MGPU_GL_FINISH=1 environment variable set, and report back if the glitches are still there with that.
Comment 8 Bug Janitor Service 2024-11-07 03:46:40 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Antonio 2024-11-07 11:51:51 UTC
(In reply to Zamundaaa from comment #7)
> If you can compile the Plasma/6.2 branch yourself, or once 6.2.3 is out with
> that commit, please test with the KWIN_DRM_FORCE_MGPU_GL_FINISH=1
> environment variable set, and report back if the glitches are still there
> with that.

Sorry I did not report back, glitches aren't there for me since 6.2, even without the KWIN_DRM_FORCE_MGPU_GL_FINISH=1 environment variable. Should I try with it or is this information enough?

Sorry for the delay again and thank you very much!
Comment 10 Bug Janitor Service 2024-11-22 03:46:41 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!