After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758073 - winsys-egl-kms: bypass initial output setup if kms fd passed in
winsys-egl-kms: bypass initial output setup if kms fd passed in
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: EGL
unspecified
Other All
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-13 19:55 UTC by Ray Strode [halfline]
Modified: 2016-02-22 18:42 UTC
See Also:
GNOME target: 3.20
GNOME version: ---


Attachments
winsys-egl-kms: bypass initial output setup if kms fd passed in (4.66 KB, patch)
2015-11-13 19:55 UTC, Ray Strode [halfline]
committed Details | Review
winsys-egl-kms: dont create 0x0 surface (8.75 KB, patch)
2016-02-22 18:40 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2015-11-13 19:55:04 UTC
if mutter is handling the output setup, then we shouldn't do it,
too.
Comment 1 Ray Strode [halfline] 2015-11-13 19:55:14 UTC
Created attachment 315431 [details] [review]
winsys-egl-kms: bypass initial output setup if kms fd passed in
Comment 2 Emmanuele Bassi (:ebassi) 2015-11-17 13:01:51 UTC
Review of attachment 315431 [details] [review]:

In general, it makes complete sense to me.

::: cogl/winsys/cogl-winsys-egl-kms.c
@@ +670,3 @@
+
+  if (kms_renderer->opened_fd < 0)
+    return TRUE;

Looking at what follows: wouldn't this break using COGL_KMS_MIRROR? I know that Mutter handles mirroring by itself, but I've recently seen that the suggestion to use that environment variable elsewhere, so we may end up breaking that.
Comment 3 Ray Strode [halfline] 2015-11-17 15:49:12 UTC
You're probably thinking of bug 750610 comment 5 where I suggested trying it. I got that quickly from reading the source, before realizing that it probably doesn't work.  Mutter immediately overrides the crtc configuration.
Comment 4 Emmanuele Bassi (:ebassi) 2015-11-17 16:22:40 UTC
(In reply to Ray Strode [halfline] from comment #3)
> You're probably thinking of bug 750610 comment 5 where I suggested trying
> it.

Likely.

> I got that quickly from reading the source, before realizing that it
> probably doesn't work.  Mutter immediately overrides the crtc configuration.

Fair. ACK from me.
Comment 5 Ray Strode [halfline] 2015-11-17 17:56:55 UTC
Attachment 315431 [details] pushed as 1887521 - winsys-egl-kms: bypass initial output setup if kms fd passed in
Comment 6 Giovanni Campagna 2015-11-21 07:23:31 UTC
This commit makes gnome-shell not start for me:

I get a glClear for a framebuffer that cogl claims is 0 by 0, and the gl call crashes mesa
(I don't have debug symbols for mesa)

Reverting I get a working shell.
Comment 7 Matthias Clasen 2015-11-24 02:17:23 UTC
Ray is out for a while. If this commit turns out to be problematic, we may have to back it out for now
Comment 8 Jason Gerecke 2015-12-11 21:03:40 UTC
(In reply to Giovanni Campagna from comment #6)
> This commit makes gnome-shell not start for me:
> 
> I get a glClear for a framebuffer that cogl claims is 0 by 0, and the gl
> call crashes mesa
> (I don't have debug symbols for mesa)
> 
> Reverting I get a working shell.

Likewise, I get a crash in mesa for both of my development systems (r600_dri.so[1] and i965_dri.so[2]). Reverting to an earlier version allows gnome-shell to start properly.


[1]: _cogl_framebuffer_gl_clear => _mesa_Clear => st_clear => st_validate_state => update_framebuffer_state => update_framebuffer_size

[2]: _cogl_framebuffer_gl_clear => _mesa_Clear => brw_clear => brw_workaround_depthstencil_alignment => get_stencil_miptree
Comment 9 bluescreen_avenger 2015-12-25 14:43:09 UTC
Indeed commit 188752158701e3a406e7fd5850b3eaf9c4798cd7 does cause problems with Intel and gnome-shell. The cursor appears, and then the display server dies

I get 
Glib-GObject-CRITICAL **; g_object_unref: assertion 'G_IS_OBJECT (object) failed
Cogl-CRITICAL **: cogl_framebuffer_set_viewport: assertion 'width > 0 && height > 0' failed

 
Reverting cogl to a583492ea2aa3ea8e78c269bd5db3f52f82aa79c allows gnome-shell to run as a Wayland Display server.
Comment 10 bluescreen_avenger 2016-01-05 23:25:09 UTC
Any updates on this? 188752158701e3a406e7fd5850b3eaf9c4798cd7 causes problems on Intel, however I'm not sure if it's just on Intel
Comment 11 bluescreen_avenger 2016-01-20 04:31:16 UTC
Any other diagnostic info I can provide?
Comment 12 Pascal Flöschel 2016-01-31 16:30:50 UTC
Seems to cause same issue with Nouveau on NVC3. Gentoo includes this patch already and gnome-shell fails to start. I removed the patch in Gentoo and rebuild cogl and gnome-shell works again.
Comment 13 Giovanni Campagna 2016-02-18 23:18:58 UTC
I tried again today and it's still crashing in the same way. Patch needs reverting.

Full backtrace:

  • #0 brw_workaround_depthstencil_alignment
    from /usr/lib64/dri/i965_dri.so
  • #1 brw_clear
    from /usr/lib64/dri/i965_dri.so
  • #2 _cogl_framebuffer_gl_clear
    at driver/gl/cogl-framebuffer-gl.c line 1022
  • #3 cogl_framebuffer_clear4f
    at cogl-framebuffer.c line 388
  • #4 cogl_framebuffer_clear
    at cogl-framebuffer.c line 457
  • #5 clutter_root_node_pre_draw
    at clutter-paint-nodes.c line 116
  • #6 _clutter_paint_node_paint
    at clutter-paint-node.c line 955
  • #7 _clutter_paint_node_paint
    at clutter-paint-node.c line 966
  • #8 clutter_actor_paint_node
    at clutter-actor.c line 3725
  • #9 clutter_actor_continue_paint
    at clutter-actor.c line 4014
  • #10 clutter_actor_paint
    at clutter-actor.c line 3938
  • #11 clutter_actor_paint
    at clutter-actor.c line 3964
  • #12 _clutter_stage_do_paint
    at clutter-stage.c line 687
  • #13 clutter_stage_cogl_redraw
    at cogl/clutter-stage-cogl.c line 548
  • #14 clutter_stage_do_redraw
    at clutter-stage.c line 1130
  • #15 _clutter_stage_do_update
    at clutter-stage.c line 1186
  • #16 master_clock_update_stages
    at clutter-master-clock-default.c line 443
  • #17 clutter_clock_dispatch
    at clutter-master-clock-default.c line 567
  • #18 g_main_dispatch
    at gmain.c line 3154
  • #19 g_main_context_dispatch
    at gmain.c line 3769
  • #20 g_main_context_iterate
    at gmain.c line 3840
  • #21 g_main_loop_run
    at gmain.c line 4034
  • #22 meta_run
    at core/main.c line 521
  • #23 main
    at main.c line 471

Comment 14 Ray Strode [halfline] 2016-02-22 18:40:14 UTC
hey sorry for sitting on this.  i was on paternity leave and then it fell off my radar when I got back, will push fix
Comment 15 Ray Strode [halfline] 2016-02-22 18:40:44 UTC
Created attachment 321882 [details] [review]
winsys-egl-kms: dont create 0x0 surface

commit 188752158 changed cogl to stop needlessly creating its own
monitor output configuration when mutter would just soon overwrite
it anyway.

Unfortunately, that commit is causing a crash in some cases because
cogl will now create and later draw to a 0x0 egl surface until mutter
sets the monitor layout.

This commit changes cogl to avoid creating and using a surface, before
it knows how big of a surface to create.
Comment 16 Ray Strode [halfline] 2016-02-22 18:42:08 UTC
(i'm pushing this now since I don't expect to get any review comments, but if anyone has any please chime in!)

Attachment 321882 [details] pushed as 1c1ad69 - winsys-egl-kms: dont create 0x0 surface