Bug 345532 - Severe graphical corruption after configuring multiple displays
Summary: Severe graphical corruption after configuring multiple displays
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.2.2
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-26 03:36 UTC by Nikarul Torhia
Modified: 2021-11-06 20:42 UTC (History)
8 users (show)

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


Attachments
Crash report from plasma shell after applying monitor configuration changes in System Settings -> Display Settings. (38.34 KB, text/plain)
2015-03-27 01:48 UTC, Nikarul Torhia
Details
Output of "qdbus org.kde.KWin /KWin supportInformation" during graphical corruption (5.45 KB, text/plain)
2015-03-27 02:47 UTC, Nikarul Torhia
Details
Output of glxinfo (65.72 KB, text/plain)
2015-03-28 03:27 UTC, Nikarul Torhia
Details
91764: Output of "qdbus org.kde.KWin /KWin supportInformation" during normal operation (5.45 KB, text/plain)
2015-03-28 13:42 UTC, Nikarul Torhia
Details
Kwin info when external screen work (5.02 KB, text/plain)
2015-03-30 10:40 UTC, Siddhartha
Details
glxinfo -l (25.34 KB, text/plain)
2015-03-30 10:40 UTC, Siddhartha
Details
glxinfo -l output (78.28 KB, text/plain)
2015-03-30 13:04 UTC, Nikarul Torhia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikarul Torhia 2015-03-26 03:36:50 UTC
I went into system settings and changed the layout of my monitors to match their physical layout.  After applying the settings, the display became corrupted.  It appeared to be an OpenGL related issue, as the screen was drawn with fragmented triangles.  I had to restart X to fix the problem, however I was able to properly adjust the monitors while compositing was disabled.  Re-enabling compositing and restarting after the correct layout had been saved also worked correctly.

Reproducible: Always

Steps to Reproduce:
1. Adjust monitor layout in system-settings while compositing is enabled.
2.Apply settings.
3.Enjoy the "triangle soup" that follows.

Actual Results:  
An unusable corrupted desktop.  Maybe with the proper monitor layout, maybe not, can't tell.

Expected Results:  
The monitors should be laid out as configured without any corrupted rendering.

I have GeForce GTX 770, and use the binary nvidia drivers, version 331.20, with Linux kernel 3.19.2 (gentoo-sources)
Comment 1 Martin Flöser 2015-03-26 07:22:59 UTC
could you please run:
qdbus org.kde.KWin /KWin supportInformation

ideally when the problem is visible (e.g. from tty1, redirected to temp file).
Comment 2 Thomas Lübking 2015-03-26 07:31:45 UTC
You may want to try:

diff --git a/scene_opengl.cpp b/scene_opengl.cpp
index b33ec8c..95d47b0 100644
--- a/scene_opengl.cpp
+++ b/scene_opengl.cpp
@@ -866,7 +866,9 @@ void SceneOpenGL::screenGeometryChanged(const QSize &size)
     m_backend->screenGeometryChanged(size);
     ShaderManager::setVirtualScreenSize(size);
     GLRenderTarget::setVirtualScreenSize(size);
-    GLVertexBuffer::setVirtualScreenSize(size);
+    GLVertexBuffer::cleanup();
+    GLVertexBuffer::initStatic();
+//     GLVertexBuffer::setVirtualScreenSize(size);
     ShaderManager::instance()->resetAllShaders();
 }
Comment 3 Nikarul Torhia 2015-03-27 01:48:22 UTC
Created attachment 91763 [details]
Crash report from plasma shell after applying monitor configuration changes in System Settings -> Display Settings.

I rebuilt a few things today (enabled the 'wayland' and 'egl' USE flags) and updated my video drivers to nvidia-drivers-349.12, and now I can't reproduce the graphical corruption.  I am able to crash plasma and otherwise have strange behavior when configuring screens (one screen tends to always become disabled, and the positioning is sometimes off), however it returns to a working state after restarting X.  I believe these same issues were present with the graphical corruption, it just overshadowed them.  Attaching the crash dump I get when changing the monitor configuration (which, admittedly, may or may not be related to the original bug).

Since I can't reproduce the bug, I can't test the patch above or provide information while the bug is in effect.  I can still provide the information from during normal operation if that would be of any use.
Comment 4 Nikarul Torhia 2015-03-27 02:47:02 UTC
Created attachment 91764 [details]
Output of "qdbus org.kde.KWin /KWin supportInformation" during graphical corruption

Spoke too soon.  After resuming from sleep (via pm-suspend on the command line), I encountered a similar graphical corruption.  Attached is the kwin support info that was requested.
Comment 5 Martin Flöser 2015-03-27 07:06:52 UTC
> Created attachment 91764 [details]
>   --> https://bugs.kde.org/attachment.cgi?id=91764&action=edit
> Output of "qdbus org.kde.KWin /KWin supportInformation" during graphical
> corruption

Thanks. Can you please also do it when it is OK. Just have an idea which needs 
to be verified ;-)

Oh and please provide glxinfo -l
Comment 6 Nikarul Torhia 2015-03-28 03:27:59 UTC
Created attachment 91789 [details]
Output of glxinfo

Martin:  Output of glxinfo attached as requested.

Thomas:  After applying your patch I haven't had any corruption after resuming from suspend.  Not sure its 100% reproducible, though.  I'll report back if it happens again with the patch.
Comment 7 Nikarul Torhia 2015-03-28 13:42:43 UTC
Created attachment 91793 [details]
91764: Output of "qdbus org.kde.KWin /KWin supportInformation" during normal operation

Attached is the output of qdbus when running normally.  Seems very similar, just a couple things shuffled around.  Note that this is with the patched kwin.
Comment 8 Nikarul Torhia 2015-03-29 00:32:02 UTC
Got the graphical corruption after resume again, with the patched kwin_x11 executable.  Also discovered I could run "DISPLAY=:0 kwin_x11 --replace" from the console and it would return to normal operation without having to restart X.  Handy.
Comment 9 Martin Flöser 2015-03-30 06:28:09 UTC
Can you please do:
glxinfo -l

it looks like the output is without "-l"
Comment 10 Thomas Lübking 2015-03-30 07:46:56 UTC
FWWI: i'm currently on a branch w/o patch in comment #2 and just got that error (scattered content fragments juddering across the screen - problem doesn't "fix" on invoking present windows or xrefresh.
Comment 11 Siddhartha 2015-03-30 10:39:23 UTC
Hi. I'm facing the same issue I think. Anytime I attach or detach external screens, I'm getting graphical corruption and have to logout and login to get normal desktop.

Attaching requested info
Comment 12 Siddhartha 2015-03-30 10:40:00 UTC
Created attachment 91816 [details]
Kwin info when external screen work
Comment 13 Siddhartha 2015-03-30 10:40:28 UTC
Created attachment 91818 [details]
glxinfo -l
Comment 14 Nikarul Torhia 2015-03-30 13:04:33 UTC
Created attachment 91820 [details]
glxinfo -l output

Oops.  glxinfo -l is attached.
Comment 15 Siddhartha 2015-04-01 13:52:27 UTC
Hi. Did anyone had a chance to look into this? 

Changing the screen configuration from Display Configuration or attaching/removing external screens corrupts all the displays.

Executing 'kwin_x11 --replace' fixes all the displays as a workaround.
Comment 16 Thomas Lübking 2015-04-01 14:23:15 UTC
see comment #2?
Comment 17 Siddhartha 2015-04-01 14:53:38 UTC
Hi Thomas. The patch does not seems to help. Getting the same issue with patch applied.
Comment 18 Siddhartha 2015-04-22 20:32:51 UTC
Hmm, so the issue seems to have gone for me. The only changes are in Kwin (git master) and Mesa (10.5.3) version updates, 

Could also be some setting changes, will test some more and report back.

Cheers!
Comment 19 Thomas Lübking 2015-04-22 20:35:47 UTC
https://git.reviewboard.kde.org/r/123461/ ?
Comment 20 Siddhartha 2015-04-22 20:43:14 UTC
(In reply to Thomas Lübking from comment #19)
> https://git.reviewboard.kde.org/r/123461/ ?

Hey Thomas, yeah this could it :)
Comment 21 Alexey Dyachenko 2015-06-08 10:42:23 UTC
I'm on 5.3.1 and this still happens every time I change screens (I do that every login because of https://bugs.kde.org/show_bug.cgi?id=347469).
Comment 22 Thomas Lübking 2015-06-08 12:42:21 UTC
nvidia?
Likely bug #344326 -> https://git.reviewboard.kde.org/r/123936/ (5.4)

(Siddhartha is on the MESA intel driver)
Comment 23 Alexey Dyachenko 2015-06-08 13:09:09 UTC
(In reply to Thomas Lübking from comment #22)
> nvidia?
> Likely bug #344326 -> https://git.reviewboard.kde.org/r/123936/ (5.4)
> 
> (Siddhartha is on the MESA intel driver)

Yup. I built kwin-git, and while artifacts are still visible for a second it then recovers.
Comment 24 Thomas Lübking 2015-06-08 18:26:53 UTC
(In reply to Alexey Dyachenko from comment #23)

> Yup. I built kwin-git, and while artifacts are still visible for a second it
> then recovers.

Good to know.
The woraround compresses several GL warnings, but you may try to lower the timeout (currently 250ms)
Comment 25 Marcelo Bossoni 2015-07-19 00:59:37 UTC
So,
this bug is something like this?
https://drive.google.com/file/d/0BzXlzIyJc44kUjNoNHk4RmZkaDA/view?usp=sharing
Comment 26 Thomas Lübking 2015-07-19 07:33:01 UTC
Yes (at least if you're like Nikarul, Alexey and myself on nvidia)

-> https://git.reviewboard.kde.org/r/123936/ (5.4)

Workaround:
Before or after changing the screen layout, suspend the compositor (SHIFT+Alt+F12) and resume it afterwards (same shortcut)
Comment 27 Victor B. Gonzalez 2015-08-04 08:52:23 UTC
I'd like to confirm that Thomas's workaround in comment 26 (while corruption is happening, shift+alt+F12 to toggle effects) works to resolve it.
Comment 28 Victor B. Gonzalez 2015-08-19 19:25:56 UTC
I updated Fedora 22 with "test updates" and dvratil/plasma-5-beta and changing displays not only happen faster (before it was way too long) but the triangle soup is gone. I've just changed display setups a dozen or so times and didn't run into it. I'm pretty happy so far, it looks like it's fixed in my setup.
Comment 29 Alexander Mentyu 2018-04-10 17:36:49 UTC
The issue isn't relevant?
Possibly related issues - https://bugs.kde.org/show_bug.cgi?id=368275 and https://bugs.kde.org/show_bug.cgi?id=344170
Comment 30 kde.org 2021-11-06 20:42:20 UTC
User reported issue is fixed