Bug 107530 - [Regression] widgets rendered black in gtk
Summary: [Regression] widgets rendered black in gtk
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: 18.1
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-08 23:08 UTC by Lukas K.
Modified: 2019-09-18 17:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
gtk-3 demo on mesa 18.1.5 (6.21 KB, image/png)
2018-08-08 23:08 UTC, Lukas K.
Details
OpenGL area (16.32 KB, image/png)
2018-08-10 15:31 UTC, Marina Chernish
Details

Description Lukas K. 2018-08-08 23:08:02 UTC
Created attachment 141014 [details]
gtk-3 demo on mesa 18.1.5

Starting with mesa 18.1, every widget that's not a GtkGLArea gets shows up black in a window containing a GtkGLArea. Gtk version is 3.22.30. Seems to be specific to X11, doesn't happen on wayland. Last know good mesa version is 18.0.5. I tried to bisect, but the intermediate commits didn't build. GPU is an intel HD 5500. People using other intel GPUs experienced identical behaviour.
Comment 1 Lionel Landwerlin 2018-08-10 14:26:33 UTC
What window system is GTK+ using? (Wayland/X11)
What's the compositor?

Thanks!
Comment 2 Marina Chernish 2018-08-10 15:30:33 UTC
Hi Lukas,

I've tried to reproduce it on following configuration:

OS: Linux ubuntu 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Device: Mesa DRI Intel(R) Haswell Mobile  (0x416)
CPU: Intel Core i5-4300M 
Display: server: X.Org 1.19.6 resolution: 1600x900~60Hz
Mesa 18.1.5 (git-711035e355)

also have gtk3 3.22.30 installed

and glarea looks good without any black fillouts (see attachment).

What else device types (DRI) have you observed this issue on?
Possibly some other installed applications/libraries could make some influence?
Comment 3 Marina Chernish 2018-08-10 15:31:53 UTC
Created attachment 141038 [details]
OpenGL area
Comment 4 Lukas K. 2018-08-10 20:37:09 UTC
(In reply to Lionel Landwerlin from comment #1)
> What window system is GTK+ using? (Wayland/X11)
X11 1.20.0
> What's the compositor?
None, but using compton doesn't change anything.

Seems like this issue is specific to the modesetting driver. Using the xf86-video-intel driver 1:2.99.917+831+ge7bfc906 works fine.
Comment 5 Lionel Landwerlin 2018-08-10 21:10:38 UTC
(In reply to Lukas K. from comment #4)
> (In reply to Lionel Landwerlin from comment #1)
> > What window system is GTK+ using? (Wayland/X11)
> X11 1.20.0
> > What's the compositor?
> None, but using compton doesn't change anything.
> 
> Seems like this issue is specific to the modesetting driver. Using the
> xf86-video-intel driver 1:2.99.917+831+ge7bfc906 works fine.

I can reproduce with Xwayland & gnome-shell.
Interestingly not with mutter running nested.
Comment 6 Lionel Landwerlin 2018-08-12 19:04:00 UTC
So I went back and compiled 18.0.5 and unfortunately it doesn't work for me.
All the widgets are black outside the GLArea.

Interestingly if you set LIBGL_DRI3_DISABLE=1 the rendering of the widgets sometimes appear.

GTK+ tries to be clever by reading back it's front buffer into the back buffer.

What I found is that DRI3 will outright prevent you from reading back the front buffer of a window : https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/loader/loader_dri3_helper.c#L1930
That makes the core of Mesa fill the texture unit, that should be used to sample from the front buffer of the window, use the default that is a 1x1 black texture.

You can workaround that issue by disabling the texture from pixmap mechanism of GTK+ by setting GDK_GL=software-draw-surface.

I'm not really experienced enough to tell what part of the stack is broken :(
Comment 7 Lukas K. 2018-08-12 20:46:22 UTC
(In reply to Lionel Landwerlin from comment #6)
> You can workaround that issue by disabling the texture from pixmap mechanism
> of GTK+ by setting GDK_GL=software-draw-surface.
> 
> I'm not really experienced enough to tell what part of the stack is broken :(

I opened a bug in the gtk bug tracker: https://gitlab.gnome.org/GNOME/gtk/issues/1270 Let's see what happens...
Comment 8 GitLab Migration User 2019-09-18 17:45:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/113.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.