Closed Bug 1481405 Opened 6 years ago Closed 5 years ago

[Wayland] layers.gpu-process.enabled = true is broken


(Core :: Widget: Gtk, defect, P3)




Tracking Status
firefox69 --- fixed


(Reporter: stransky, Assigned: aosmond)


(Blocks 1 open bug)



(3 files, 1 obsolete file)

In order to support Bug 1357487 - Turn on OOP extensions by default on Linux - we need to connect remote Wayland window to main application.

That's done by gdk_wayland_window_set_transient_for_exported().
Attached patch window-export-handle (obsolete) — Splinter Review
WIP - export window handle and store it at nsWindow.
Hm, the exported handle it not useful for us and we can't do OOP widget compositing on Wayland. Looks like we need to work like MacOS and go by MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING path.
Assignee: nobody → stransky
Summary: [Wayland] Export/Import window handle to allow OOP extensions → [Wayland] Support OOP extensions
Comment on attachment 8998492 [details] [diff] [review]

This has no value for OOP composition.
Attachment #8998492 - Attachment is obsolete: true
As Wayland does not support remote (from another process) drawing to widget we need to go by !MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING path when Wayland is active.
Attached patch wip patchSplinter Review
WIP patch, for the final one we need to make MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING a runtime choice for GTK+
Assignee: stransky → ozoder
Attached patch WIP 2Splinter Review
WIP 2 by Ondrej Zoder
I see no difference with those patches applied and not-applied, let's deffer this now.
Assignee: ozoder → stransky
The "remote" option is activated by layers.gpu-process.enabled = true and then we get crashes from remote gpu process.
Summary: [Wayland] Support OOP extensions → [Wayland] layers.gpu-process.enabled = true is broken
Backtrace from GPU process:

#4  0x00007ffff6ced070 in <signal handler called> () at /lib64/
#5  0x00007fffe3d01f69 in mozilla::widget::WindowSurfaceProvider::Initialize(_XDisplay*, unsigned long, Visual*, int, bool) (this=0x7fffcfd5e170, aDisplay=0x7ffff6ab9000, aWindow=0, aVisual=0x1f7f6e340, aDepth=0, aIsShaped=false)
    at /home/komat/tmp676-trunk-gtk3/src-wayland/widget/gtk/WindowSurfaceProvider.cpp:49
#6  0x00007fffe3cf2129 in mozilla::widget::GtkCompositorWidget::GtkCompositorWidget(mozilla::widget::GtkCompositorWidgetInitData const&, mozilla::layers::CompositorOptions const&, nsWindow*) (this=0x7fffcfd5e128, aInitData=..., aOptions=..., aWindow=0x0) at /home/komat/tmp676-trunk-gtk3/src-wayland/widget/gtk/GtkCompositorWidget.cpp:51
#7  0x00007fffe3cf163e in mozilla::widget::CompositorWidgetParent::CompositorWidgetParent(mozilla::widget::CompositorWidgetInitData const&, mozilla::layers::CompositorOptions const&) (this=0x7fffcfd5e100, aInitData=..., aOptions=...)
    at /home/komat/tmp676-trunk-gtk3/src-wayland/widget/gtk/CompositorWidgetParent.cpp:15
#8  0x00007fffe174ce3b in mozilla::layers::CompositorBridgeParent::AllocPCompositorWidgetParent(mozilla::widget::CompositorWidgetInitData const&) (this=0x7fffcfd56800, aInitData=...)
    at /home/komat/tmp676-trunk-gtk3/src-wayland/gfx/layers/ipc/CompositorBridgeParent.cpp:2055
#9  0x00007fffe0f1856e in mozilla::layers::PCompositorBridgeParent::OnMessageReceived(IPC::Message const&) (this=0x7fffcfd56800, msg__=...) at /home/komat/tmp676-trunk-gtk3/src-wayland/objdir/ipc/ipdl/PCompositorBridgeParent.cpp:621
#10 0x00007fffe0f1fa02 in mozilla::layers::PCompositorManagerParent::OnMessageReceived(IPC::Message const&) (this=0x7fffdd52e080, msg__=...) at /home/komat/tmp676-trunk-gtk3/src-wayland/objdir/ipc/ipdl/PCompositorManagerParent.cpp:110
With the patch pplied I get:

Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Platform does not support out-of-process compositing (t=4.5216) [GFX1-]: Platform does not support out-of-process compositing
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Platform does not support out-of-process compositing (t=4.5216) |[1][GFX1-]: Failed to create remote compositor (t=4.5218) [GFX1-]: Failed to create remote compositor

which seems to be correct as we don't support remote compositing on Wayland.
Depends on: 1534557

I have no intention to work on this right now, giving back.

Assignee: stransky → nobody
Blocks: 1549965
Priority: -- → P3
Type: enhancement → defect
Assignee: nobody → aosmond

Right now with WebRender, this will cause any qualifying nightly user on nightly to fallback to basic compositing because the GPU process crashes (they would need to opt into the GPU process mind you; still, this could be artifically suppressing WR).

To achieve the same outcome as making MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING, I believe we can just change gfxPlatform to disable the GPU process in the first place if Wayland is in use. From my own testing and comment 10, turning off MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING will just cause the GPU process to fail to setup, and then as a result, disable the GPU process. It is better to do this explicitly in gfxPlatform to allow said users to retain WebRender (which is disabled if the GPU process goes down and we fallback to the parent process).

Wayland does not support remote drawing for widgets from another process
at this time. As such, it is best to force disable the GPU process, so
that users will be able to get WebRender with Wayland.

Pushed by
Force disable the GPU process if using Wayland. r=kats,stransky
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.