Bug 456499 - KWin Magic Lamp effect causing black screen (X11 + Wayland)
Summary: KWin Magic Lamp effect causing black screen (X11 + Wayland)
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: 5.25.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-09 06:15 UTC by Brennan Kinney
Modified: 2022-07-13 20:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brennan Kinney 2022-07-09 06:15:55 UTC
Using the Magic Lamp effect with windows of a certain area size causes the display to be flooded with a black fill.

Recovery on Wayland may not be possible.

On X11 it is possible to recovery by disabling the compositor with alt+shift+f12 in the guest. This would repaint the screen.

---

### Additional Details

Without recovering by toggling the compositor, the desktop remains interactive. I was able to click the bottom-left of the display where the application launcher button should be, and a white rectangle is drawn at the expected size of the applet. In some cases other colours bleed through, but the screen is mostly painted black.

The window may need to be large. I was able to consistently reproduce with Konsole at "width x height" values of 1673x395, 1670x432, 912x822, 595x1230 or larger. Slightly smaller height or width dimension than those example dimensions worked correctly. At 1360x768 guest resolution, a maximized system-settings window would reproduce the bug too.

These sizes were consistent at reproducing regardless of the set display resolution (1080p and 1360x768 tested, as well as maximized VM guest display on host 1440p monitor).

I tried with all other effects disabled, no change in behaviour. The problem does not occur when the Magic Lamp effect is disabled. Adjusting the animation duration from Default, did not seem to make a difference. Nor does it seem to matter what toolkit is used for the window (GTK or Qt).

At one point, when using the effect on windows that did not trigger the issue, the effect was degraded to what looked like maybe 6 sided geometry? The smooth curved distortion of the effect was replaced with a single point bend, but I am not sure how to reproduce that.

---

This was reproduced on Fedora 36, EndeavourOS, and openSUSE Tumbleweed.

All were tested as fresh VMware VM guest installs with 3D accel (driver SVGA3D/vmwgfx) enabled.

Thus it may be a bug specifically affecting VMware hypervisor support, I have not yet updated to reproduce on my host system (Manjaro with Nvidia proprietary drivers). VMware has since the Workstation 16 series handled 3D accel guests running on linux hosts via Vulkan host driver which may affect reproduction.

---

STEPS TO REPRODUCE
1. Enable the Magic Lamp effect.
2. Minimize (or the opposite restoring the minimized window) a window with a large enough area size (eg maximized window).
3. Screen should be filled with black.
4. If not, one of the distros may need to be used with the free VMware Workstation 16 Player hypervisor to reproduce in a VM with 3D accel enabled.


OBSERVED RESULT
Black screen, unable to recover in a Wayland session.

EXPECTED RESULT
For the effect to work consistently and without the black fill.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220706
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.9
Graphics Platform: X11
Graphics Processor: SVGA3D
Extra: xorg: 21.1.3, xwayland 22.1.2, mesa 22.1.2, vmwgfx 2.20.0

Operating System: EndeavourOS
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.9
Graphics Platform: X11
Graphics Processor: SVGA3D
Extra: xorg: 21.1.3, xwayland 22.1.2, mesa 22.1.2, vmwgfx 2.20.0

Operating System: Fedora 36
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.3
Kernel Version: 5.18.9
Graphics Platform: X11
Graphics Processor: SVGA3D
Extra: xorg: 1.20.14, xwayland 22.1.2, mesa 22.1.2, vmwgfx 2.20.0

---

When recovering by toggling the kwin compositor via alt+shift+f12, `journalctl -b0` outputs the following (openSUSE TW):

Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: OpenGL vendor string:                   VMware, Inc.
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: OpenGL renderer string:                 SVGA3D; build: RELEASE;  LLVM;
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: OpenGL version string:                  4.1 (Compatibility Profile) Mesa 22.1.3
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: OpenGL shading language version string: 4.10
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: Driver:                                 VMware (SVGA3D)
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: GPU class:                              Unknown
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: OpenGL version:                         4.1
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: GLSL version:                           4.10
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: Mesa version:                           22.1.3
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: X server version:                       1.21.1
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: Linux kernel version:                   5.18.9
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: Requires strict binding:                yes
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: GLSL shaders:                           yes
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: Texture NPOT support:                   yes
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: Virtual Machine:                        yes
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: QObject::connect(KWin::InputMethod, KWin::EffectsHandlerImpl): invalid nullptr parameter
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: ZoomConfig::instance called after the first use - ignoring
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: SlideConfig::instance called after the first use - ignoring
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: MagicLampConfig::instance called after the first use - ignoring
Jul 09 18:00:02 localhost.localdomain kwin_x11[1519]: KscreenConfig::instance called after the first use - ignoring
Jul 09 18:00:02 localhost.localdomain xdg-desktop-portal-kde[1877]: xdp-kde-settings: Read called with parameters:
Jul 09 18:00:02 localhost.localdomain xdg-desktop-portal-kde[1877]: xdp-kde-settings:     group:  "org.freedesktop.appearance"
Jul 09 18:00:02 localhost.localdomain xdg-desktop-portal-kde[1877]: xdp-kde-settings:     key:  "color-scheme"



Fedora output similar logs, notable with the QXcbConnection lines. these are related to toggling the compositor off, and then back on (timestamp groups). No specific logs appear here or in `dmesg` output when the actual graphical error occurs though:

Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 12683, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 12684, resource id: 27265202, major code: 55 (CreateGC), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 12685, resource id: 27265202, major code: 72 (PutImage), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 12686, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 12687, resource id: 27265204, major code: 55 (CreateGC), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 12688, resource id: 27265204, major code: 72 (PutImage), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 12689, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 12690, resource id: 27265206, major code: 55 (CreateGC), minor code: 0
Jul 09 18:04:49 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 12691, resource id: 27265206, major code: 72 (PutImage), minor code: 0
Jul 09 18:05:12 fedora kwin_x11[1349]: OpenGL vendor string:                   VMware, Inc.
Jul 09 18:05:12 fedora kwin_x11[1349]: OpenGL renderer string:                 SVGA3D; build: RELEASE;  LLVM;
Jul 09 18:05:12 fedora kwin_x11[1349]: OpenGL version string:                  4.1 (Compatibility Profile) Mesa 22.1.3
Jul 09 18:05:12 fedora kwin_x11[1349]: OpenGL shading language version string: 4.10
Jul 09 18:05:12 fedora kwin_x11[1349]: Driver:                                 VMware (SVGA3D)
Jul 09 18:05:12 fedora kwin_x11[1349]: GPU class:                              Unknown
Jul 09 18:05:12 fedora kwin_x11[1349]: OpenGL version:                         4.1
Jul 09 18:05:12 fedora kwin_x11[1349]: GLSL version:                           4.10
Jul 09 18:05:12 fedora kwin_x11[1349]: Mesa version:                           22.1.3
Jul 09 18:05:12 fedora kwin_x11[1349]: X server version:                       1.20.14
Jul 09 18:05:12 fedora kwin_x11[1349]: Linux kernel version:                   5.18.9
Jul 09 18:05:12 fedora kwin_x11[1349]: Requires strict binding:                yes
Jul 09 18:05:12 fedora kwin_x11[1349]: GLSL shaders:                           yes
Jul 09 18:05:12 fedora kwin_x11[1349]: Texture NPOT support:                   yes
Jul 09 18:05:12 fedora kwin_x11[1349]: Virtual Machine:                        yes
Jul 09 18:05:12 fedora kwin_x11[1349]: QObject::connect(KWin::InputMethod, KWin::EffectsHandlerImpl): invalid nullptr parameter
Jul 09 18:05:12 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 4 (BadPixmap), sequence: 13008, resource id: 27265202, major code: 54 (FreePixmap), minor code: 0
Jul 09 18:05:12 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 13 (BadGC), sequence: 13009, resource id: 27265203, major code: 60 (FreeGC), minor code: 0
Jul 09 18:05:12 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 4 (BadPixmap), sequence: 13010, resource id: 27265204, major code: 54 (FreePixmap), minor code: 0
Jul 09 18:05:12 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 13 (BadGC), sequence: 13011, resource id: 27265205, major code: 60 (FreeGC), minor code: 0
Jul 09 18:05:12 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 4 (BadPixmap), sequence: 13012, resource id: 27265206, major code: 54 (FreePixmap), minor code: 0
Jul 09 18:05:12 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 13 (BadGC), sequence: 13013, resource id: 27265207, major code: 60 (FreeGC), minor code: 0
Jul 09 18:07:40 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 15123, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Jul 09 18:07:40 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 15124, resource id: 27265414, major code: 55 (CreateGC), minor code: 0
Jul 09 18:07:40 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 15125, resource id: 27265414, major code: 72 (PutImage), minor code: 0
Jul 09 18:07:40 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 15126, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Jul 09 18:07:40 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 15127, resource id: 27265416, major code: 55 (CreateGC), minor code: 0
Jul 09 18:07:40 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 15128, resource id: 27265416, major code: 72 (PutImage), minor code: 0
Jul 09 18:07:40 fedora plasmashell[1378]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 15129, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Comment 1 Brennan Kinney 2022-07-09 08:57:58 UTC
I forgot to add that I did test with the official Breeze theme.

---

This bug may only affect VMware guests.

There is a related bug report from 2017 that describes this bug more briefly, and later discovers a workaround via an ENV that drops OpenGL in the guest down to 2.1:

https://bugs.kde.org/show_bug.cgi?id=376115#c4

> `export SVGA_VGPU10=0` anywhere so it would be applied to all 3D apps.

[Referencing Mesa SVGA3D driver docs](https://docs.mesa3d.org/drivers/svga3d.html) (which seems a bit outdated in content)

> OpenGL 3.3 support can be disabled by setting the environment variable SVGA_VGPU10=0. You will then have OpenGL 2.1 support. This may be useful to work around application bugs (such as incorrect use of the OpenGL 3.x core profile).

---

Setting the ENV into the bash profile and restarting, the graphical failure is no longer reproducible:

    $ echo "export SVGA_VGPU10=0" >> ~/.bashrc

Fedora 36 logs (journalctl -b0) after toggling the compositor on:

Jul 09 18:48:17 fedora kwin_x11[1304]: OpenGL vendor string:                   VMware, Inc.
Jul 09 18:48:17 fedora kwin_x11[1304]: OpenGL renderer string:                 SVGA3D; build: RELEASE;  LLVM;
Jul 09 18:48:17 fedora kwin_x11[1304]: OpenGL version string:                  2.1 Mesa 22.1.3
Jul 09 18:48:17 fedora kwin_x11[1304]: OpenGL shading language version string: 1.20
Jul 09 18:48:17 fedora kwin_x11[1304]: Driver:                                 VMware (SVGA3D)
Jul 09 18:48:17 fedora kwin_x11[1304]: GPU class:                              Unknown
Jul 09 18:48:17 fedora kwin_x11[1304]: OpenGL version:                         2.1
Jul 09 18:48:17 fedora kwin_x11[1304]: GLSL version:                           1.20
Jul 09 18:48:17 fedora kwin_x11[1304]: Mesa version:                           22.1.3
Jul 09 18:48:17 fedora kwin_x11[1304]: X server version:                       1.20.14
Jul 09 18:48:17 fedora kwin_x11[1304]: Linux kernel version:                   5.18.9
Jul 09 18:48:17 fedora kwin_x11[1304]: Requires strict binding:                yes
Jul 09 18:48:17 fedora kwin_x11[1304]: GLSL shaders:                           yes
Jul 09 18:48:17 fedora kwin_x11[1304]: Texture NPOT support:                   yes
Jul 09 18:48:17 fedora kwin_x11[1304]: Virtual Machine:                        yes
Jul 09 18:48:18 fedora kwin_x11[1304]: QObject::connect(KWin::InputMethod, KWin::EffectsHandlerImpl): invalid nullptr parameter

---

It may still be considered a possible bug in the effect. But I am also aware of Chrome based web browsers all having rendering issues unless switching to their Vulkan experimental rendering backend (in chrome://flags), that workaround is not required when OpenGL drivers are reset to 2.1.

The fix worked for both openSUSE Tumbleweed and Fedora 36, but NOT for EndeavourOS. It is unclear why, but it may be a timing issue? 

`inxi -G` and `glxinfo | grep -i opengl` both report OpenGL 2.1, but kwin (X11 and Wayland) is started with OpenGL 4.1, requiring manual `kwin_x11 --replace &` to be run to restart kwin when it will then also use OpenGL 2.1.

I have run without systemd startup for EndeavourOS:

    kwriteconfig5 --file startkderc --group General --key systemdBoot false
    qdbus org.kde.KWin /KWin supportInformation | grep -i opengl

This did not help and still required manually restarting kwin to switch OpenGL used from 4.1 to 2.1. The ENV set in bashrc is perhaps applied too late for this distro with kwin initializing earlier?
Comment 2 Brennan Kinney 2022-07-10 05:47:15 UTC
I have created a 3D accel VM guest with a different hypervisor (QEMU-KVM), and cannot reproduce the Magic Lamp effect bug described here.

It appears to be specific to the VMware GPU driver SVGA3D/vmwgfx. Mesa has a related issue about the Magic Lamp effect bug with SVGA3D originally reported in 2017 here: https://gitlab.freedesktop.org/mesa/mesa/-/issues/889

I'll leave this bug report open, if a developer wants to assess if there is a bug in the Magic Lamp effect, or close it as a driver bug.

---

If at all useful, the output of `glxinfo | grep -i opengl` reports:

For virgl:
- OpenGL core profile version string: 4.3 (same as reported by `inxi -G`)
- OpenGL version string: 3.1 (which kwin uses)
- OpenGL ES: 3.2

For SVGA3D:
- OpenGL core profile version string: 4.1
- OpenGL version string: 4.1 (notes that it's a Compatibility profile)
- OpenGL ES: 3.0

For SVGA3D (with ENV `SVGA_VGPU10=0` which avoids the bug):
- Not Present => OpenGL core profile version string
- OpenGL version string: 2.1
- OpenGL ES: 2.0