Bug 447705 - Flickering in Wayland session (most often when returning from standby)
Summary: Flickering in Wayland session (most often when returning from standby)
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.24.2
Platform: Kubuntu Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland
: 450329 450780 451325 451914 452405 453396 453413 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-12-30 19:04 UTC by Jan Rathmann
Modified: 2024-07-08 08:24 UTC (History)
14 users (show)

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


Attachments
Output of lshw (21.61 KB, text/plain)
2021-12-30 19:14 UTC, Jan Rathmann
Details
Video showing the flickering (2.92 MB, video/webm)
2021-12-30 19:33 UTC, Jan Rathmann
Details
Output of journalctl --user-unit plasma-kwin_wayland (5.32 KB, text/x-log)
2022-02-10 22:25 UTC, Jan Rathmann
Details
Output of dmesg (78.87 KB, text/x-log)
2022-02-10 22:27 UTC, Jan Rathmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Rathmann 2021-12-30 19:04:20 UTC
Most of the time, when returning my PC from standby/suspend-to-RAM, there is a heavy flickering on the whole screen (video attached). It immediately goes away when I click inside a window or move the cursor over a panel.

Only Wayland session is affected, I never saw this under X11 (I noticed this when I switched to Wayland by default since ~2 months).

I noticed the following pattern:
- When the system  has been powered off completely, there is sometimes no flickering on the first or even on the second time the system is resumed
- If there was one resume with flickering, there will be flickering too on all the following resumes (as long as I don't restart/power off the system completely). 

I have attached the output of lshw for my system, in case it helps.

Linux/KDE Plasma: Kubuntu 21.10 with Backports-PPA
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89
Qt Version:  5.15.2
Comment 1 Jan Rathmann 2021-12-30 19:14:09 UTC
Created attachment 144975 [details]
Output of lshw
Comment 2 Jan Rathmann 2021-12-30 19:33:16 UTC
Created attachment 144976 [details]
Video showing the flickering
Comment 3 Nate Graham 2022-01-12 01:10:47 UTC
Do you have an Intel UHD 620 GPU? If so, this is almost certainly https://gitlab.freedesktop.org/mesa/mesa/-/issues/5731.
Comment 4 Jan Rathmann 2022-01-12 09:06:54 UTC
(In reply to Nate Graham from comment #3)
> Do you have an Intel UHD 620 GPU? If so, this is almost certainly
> https://gitlab.freedesktop.org/mesa/mesa/-/issues/5731.

No, I have an Asus AMD Radeon R7 240 card.

Beside this, in the linked report I could not see any hint that it is related to suspend/resume like my report. So it seems to me that this is a different issue than mine.
Comment 5 Nate Graham 2022-01-13 18:48:23 UTC
Thanks.
Comment 6 Aleix Pol 2022-02-10 14:33:15 UTC
Would you be able to provide some system logs? you should be able to get them with the following command:
journalctl --user-unit plasma-kwin_wayland 

Also you can see if there's errors from the drivers using dmesg.
Comment 7 Jan Rathmann 2022-02-10 22:25:38 UTC
Created attachment 146557 [details]
Output of journalctl --user-unit plasma-kwin_wayland

Ok, I'm not sure if there's anything suspicious here.
Comment 8 Jan Rathmann 2022-02-10 22:27:27 UTC
Created attachment 146558 [details]
Output of dmesg

I'm attaching the output of dmesg here too. At first glance I couldn't see errors that seems cleary related to the graphics driver.
Comment 9 Aleix Pol 2022-02-10 23:52:27 UTC
I see this on dmesg, it could be related.

[10956.771516] [drm] Fence fallback timer expired on ring sdma0
[10957.315506] [drm] Fence fallback timer expired on ring sdma0
[10957.827495] [drm] Fence fallback timer expired on ring sdma0
[10958.339484] [drm] Fence fallback timer expired on ring sdma0
[10958.851473] [drm] Fence fallback timer expired on ring sdma0
[10959.363464] [drm] Fence fallback timer expired on ring sdma0
[10959.540717] [drm] UVD initialized successfully.
[10959.868009] OOM killer enabled.
[10959.868014] Restarting tasks ...
Comment 10 Michael D 2022-02-14 09:03:31 UTC
Exact same problem here on Ryzen 4500U with integrated Renoir Vega 6 GPU. Using Manjaro testing, Plasma 5.23.5.
Comment 11 giuseppe 2022-03-04 10:46:35 UTC
Similar problem here, but the flickering is just in the background, if i have a window opened it isn't affected. It's sufficient to open a dialog menu or application launcher to make it stop.
Intel core i7 1065g7 and Iris Plus graphics.
Plasma 5.24.2 
KDE Frameworks 5.91
Qt Version 5.15.2
Comment 12 postix 2022-03-04 12:54:13 UTC
*** Bug 450329 has been marked as a duplicate of this bug. ***
Comment 13 postix 2022-03-04 13:11:35 UTC
Like I have reported in #450329 (including screen recordings etc.), I see this flickering on Wayland with KWin 5.24.2 and and AMD RX580 graphics card and dual screen (hdmi + dp), in general (with some exceptions) when I unlock my locked session.

It's always only one of the screen which flickers (strobe): Sometimes the whole screen, sometimes parts of it, sometimes it seems to be synchronized with the mouse movement. However, as in the OP described, it goes away, when clicking somewhere.
Comment 14 mjeff 2022-03-05 05:01:17 UTC
Same issue on my end (Intel Iris xe graphics on an i7-1185G7)

There are also issues where, when resuming a session, unlocking the desktop, etc. my laptop screen is suddenly activated (even when it is closed) and the wallpaper on my 4k screen shrinks to fill just 1/4 of the screen (like when you snap a window to the upper right of a screen)

I have to reopen my laptop lid, close it again, change my main screen resolution briefly and then set it back to 4k, and then it works fine again (I have to follow these steps every time)

I see the following entries in my logs in regards to the flickering:
3/5/22 8:58 AM	xdg-desktop-portal-kde	xdp-kde-background: GetAppState called: no parameters
3/5/22 8:59 AM	xdg-desktop-portal-kde	xdp-kde-background: GetAppState called: no parameters
3/5/22 8:59 AM	xdg-desktop-portal-kde	xdp-kde-background: GetAppState called: no parameters
Comment 15 Bacteria 2022-03-10 07:35:37 UTC
*** Bug 451325 has been marked as a duplicate of this bug. ***
Comment 16 TotallySpoked133 2022-03-17 19:27:40 UTC
I'm experiencing this same issue as well. Seems to be intermittent (at least for me), sometimes resuming from lock results in no flickering, but other times it's exactly as the above comments describe. It flickers with each pixel the mouse moves, creating a strobe effect when moving the mouse a multitude of pixels at a time. The area that flickers is always outside of the currently focused application, and it goes away when clicking anywhere outside of the currently focused window.

This line appears in ~/.local/share/sddm/wayland-session.log after unlocking, I suspect it may be related:
-------------------------------------------------------------------------------------------------------
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/UserList.qml:42:9: Unable to assign [undefined] to bool
-------------------------------------------------------------------------------------------------------


I'm using Intel Integrated Graphics, here's the output of 'inxi -G' if it helps:

--------------------------------------------------------------------------------------------------------
Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel
  Display: wayland server: X.org v: 1.21.1.3 with: Xwayland v: 22.1.0
    compositor: kwin_wayland driver: X: loaded: modesetting gpu: i915
    resolution: 1920x1200
  OpenGL: renderer: Mesa Intel Xe Graphics (TGL GT2) v: 4.6 Mesa 21.3.7
--------------------------------------------------------------------------------------------------------

Operating System: Arch Linux
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Comment 17 TotallySpoked133 2022-03-17 19:34:53 UTC
*** Bug 450780 has been marked as a duplicate of this bug. ***
Comment 18 postix 2022-03-27 09:22:43 UTC
I have now experienced it several times in Thunderbird 91.7.0 on openSUSE TW: I got a vertical layout with "Folders" and "Message Pane" (three columns in total) and when I go through my received mails, it may happen that the right pane with the message content starts to flicker in this bug's sense. 

Unfortunately, I can only reproduce it by chance.
Comment 19 Aleix Pol 2022-03-28 01:08:51 UTC
I can confirm this behaviour, I cannot reliably reproduce it though.

It seems to me that we are never issuing the full repaint we need in the DamageJournal (?).
Comment 20 Aleix Pol 2022-03-28 01:45:46 UTC
Submitted this fix, maybe someone can confirm it addresses the issue as well?
https://invent.kde.org/plasma/kwin/-/merge_requests/2188
Comment 21 Etaash Mathamsetty 2022-03-28 02:13:56 UTC
bug 450780 is not a duplicate, on the corners of my screen where no windows are, the whole screen doesn't flicker, but let's see if the aforementioned fix, fixes my issue as well.
Comment 22 Jan Rathmann 2022-03-28 19:29:18 UTC
(In reply to Aleix Pol from comment #20)
> Submitted this fix, maybe someone can confirm it addresses the issue as well?
> https://invent.kde.org/plasma/kwin/-/merge_requests/2188

The first patch from this morning seems to make no difference for me (flickering is still there). I can try to make a build with the additional changes tomorrow or so.
Comment 23 David Edmundson 2022-04-08 23:05:16 UTC
*** Bug 452405 has been marked as a duplicate of this bug. ***
Comment 24 Jan Rathmann 2022-04-12 19:36:33 UTC
(In reply to Aleix Pol from comment #20)
> Submitted this fix, maybe someone can confirm it addresses the issue as well?
> https://invent.kde.org/plasma/kwin/-/merge_requests/2188

Sorry, took a while to test the patch, had to figure out how to build patched Kwin on my test installation of Neon Unstable.

Unfortunately, the patch from the merge request doesn't fix the bug for me - still flickering after resume sometimes.

Maybe it's relevant to mention that I don't have screen locking enabled (no password prompt on resume).
Comment 25 Aleix Pol 2022-04-13 12:13:58 UTC
Git commit d3259fe94593ecad247faf9dc1b697512aa88080 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 13/04/2022 at 11:17.
Pushed by apol into branch 'master'.

Fix unlocking wayland sessions

We were never issuing a repaint which confused thoroughly the
compositor.

M  +2    -0    src/wayland_server.cpp

https://invent.kde.org/plasma/kwin/commit/d3259fe94593ecad247faf9dc1b697512aa88080
Comment 26 Aleix Pol 2022-04-13 13:39:10 UTC
Git commit ee625b2d8acad2ba81693107740a12d8a03863c0 by Aleix Pol.
Committed on 13/04/2022 at 13:34.
Pushed by apol into branch 'Plasma/5.24'.

Fix unlocking wayland sessions

We were never issuing a repaint which confused thoroughly the
compositor.

M  +3    -0    src/wayland_server.cpp

https://invent.kde.org/plasma/kwin/commit/ee625b2d8acad2ba81693107740a12d8a03863c0
Comment 27 Jan Rathmann 2022-04-13 19:43:42 UTC
I feel a bit confused that the bug is now marked as 'Fixed', after I wrote yesterday in #24 that the changes from the merge request don't fix the bug for me. Am I missing something, or was my comment somehow unclear?
Comment 28 Aleix Pol 2022-04-14 00:27:51 UTC
There was an in-between version of the MR that wasn't working well, but it was addressed.

I can easily reproduce the (now former) problem and fix it, so I think there's no doubt that the problem is fixed at least to some extent. If you can still reproduce it on the stable branch as is or master, please open a new ticket with a way for us to reproduce as I cannot reproduce the problem anymore.
Comment 29 Jan Rathmann 2022-04-14 08:51:16 UTC
(In reply to Aleix Pol from comment #28)
> There was an in-between version of the MR that wasn't working well, but it
> was addressed.

 Ah, thanks for the explanation. I'll see if I can still reproduce it on one of the branches containing the final version of the fix - it may take some time before I can a definitive answer.
Comment 30 Zamundaaa 2022-05-05 11:39:31 UTC
*** Bug 453413 has been marked as a duplicate of this bug. ***
Comment 31 kde.org 2022-05-05 12:21:40 UTC
*** Bug 453396 has been marked as a duplicate of this bug. ***
Comment 32 Jan Rathmann 2022-05-31 07:39:50 UTC
I have posted a follow-up report: https://bugs.kde.org/show_bug.cgi?id=454639
Comment 33 Aleix Pol 2022-09-20 00:27:56 UTC
*** Bug 451914 has been marked as a duplicate of this bug. ***
Comment 34 Armando Ota 2024-07-08 08:24:08 UTC
Experiencing the same problems ... 
3 monitor setup tih 9 virtual desktops 

Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.0
Kernel Version: 6.5.0-41-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-8086K CPU @ 4.00GHz
Memory: 31,3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2
NVIDIA Driver: 550.90.07
NVML version: 12.550.90.07(In reply to Jan Rathmann from comment #0)
> Most of the time, when returning my PC from standby/suspend-to-RAM, there is
> a heavy flickering on the whole screen (video attached). It immediately goes
> away when I click inside a window or move the cursor over a panel.
> 
> Only Wayland session is affected, I never saw this under X11 (I noticed this
> when I switched to Wayland by default since ~2 months).
> 
> I noticed the following pattern:
> - When the system  has been powered off completely, there is sometimes no
> flickering on the first or even on the second time the system is resumed
> - If there was one resume with flickering, there will be flickering too on
> all the following resumes (as long as I don't restart/power off the system
> completely). 
> 
> I have attached the output of lshw for my system, in case it helps.
> 
> Linux/KDE Plasma: Kubuntu 21.10 with Backports-PPA
> KDE Plasma Version: 5.23.4
> KDE Frameworks Version: 5.89
> Qt Version:  5.15.2

Experiencing the same problems ... 
3 monitor setup tih 9 virtual desktops 

Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.0
Kernel Version: 6.5.0-41-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-8086K CPU @ 4.00GHz
Memory: 31,3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2
NVIDIA Driver: 550.90.07
NVML version: 12.550.90.07