Bug 393101 - Graphical corruption with depth 30
Summary: Graphical corruption with depth 30
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (show other bugs)
Version: 5.12.4
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-13 12:58 UTC by Allan Sandfeld
Modified: 2018-04-14 07:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Wayland-
mgraesslin: X11+


Attachments
screenshot showing bad window decoration (185.23 KB, image/png)
2018-04-13 13:03 UTC, Allan Sandfeld
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Sandfeld 2018-04-13 12:58:53 UTC
If you configure X11 to use depth 30, kwin has problems with windows that uses depth 30 formats.

In most cases Qt applications will fail to use depth 30 (due to lacking GLX support), and use normal depth 24/30. These are rendered correctly by kwin. If Qt however is compiled without OpenGL support, Qt will support depth 30, and the window decoration by kwin will be rendered in the classic corruption of sending ARGB32 as RGB30.

It appears this issue is in the QPainter backend as the OpenGL backend crashes (in the Intel driver though, so probably not a kwin bug).

Try in the xrender compositor, the decorations are rendered correctly, but window effects are renderer as if send in ARGB32 to RGB30.

Looking through the code it appears to be missing code to check default format of a screen, and since it is not using QScreen, it can't use the support there.
Comment 1 Allan Sandfeld 2018-04-13 13:00:24 UTC
Btw. An easy way of seeing the corruption without changing Qt is launching Chromium. It will render its internal corrupt because GTK has terrible support for the same, but the window decoration by Kwin will also be wrong.
Comment 2 Allan Sandfeld 2018-04-13 13:03:27 UTC
Created attachment 112001 [details]
screenshot showing bad window decoration
Comment 3 Martin Flöser 2018-04-13 18:58:40 UTC
KWin does not support depth 30. As X11 ist feature frozen and this would represent a new feature, I'm sorry to say that this won't be implemented.
Comment 4 Allan Sandfeld 2018-04-13 21:51:44 UTC
So not going to fix it for wayland either? The underlying problem is the same, and you will need the underlying fixes anyway in the near future to support HDR. You need to be aware of the screen format and the format of application windows.
Comment 5 Martin Flöser 2018-04-14 06:04:42 UTC
(In reply to Allan Sandfeld from comment #4)
> So not going to fix it for wayland either?

Your bug report was about X11 and I answered for that. There are quite some differences between Wayland and X11 in this area and that's also the area where code diverged most. Any improvements in Wayland won't automatically help for X11.
Comment 6 Allan Sandfeld 2018-04-14 07:54:34 UTC
Okay. I knew X11 was closed for development. I only reported it after I noted the lack of some of the underlying things such as image format in Screen, and detection of window format. The pixel corruption wouldn't happen for wayland, but if we later support colorspaces for HDR, they would need corrections based on that.

My assumption was that once you hook up these basic things, you are likely to need anyway, I could fix the X11 side with a 10 line patch that just uses the tracked image formats.