Closed Bug 1641778 Opened 4 years ago Closed 4 years ago

[Wayland] moz_container_wayland_get_surface needs to be thread-safe

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Crash Data

Attachments

(1 file)

moz_container_wayland_get_surface needs to be thread-safe and we should lock/unlock the acquired surface.

Or better we should stop export moz_container_wayland_get_surface() but create an api for particular code like set frame callback etc.

What's the reason for us needing to wait for a frame callback on the parent to create a surface in the first place?

Splitting get_surface into create and get instead of just making it thread-safe would probably be cleaner than the slightly odd auto-creation thing we have going on right now. If we could get creation done without waiting for a frame, we'd be able to get things on screen a frame faster, and we would probably be able to kill the "initial_draw_cb" thing.

(In reply to Kenny Levinsen :kennylevinsen from comment #2)

What's the reason for us needing to wait for a frame callback on the parent to create a surface in the first place?

Splitting get_surface into create and get instead of just making it thread-safe would probably be cleaner than the slightly odd auto-creation thing we have going on right now. If we could get creation done without waiting for a frame, we'd be able to get things on screen a frame faster, and we would probably be able to kill the "initial_draw_cb" thing.

Because we create a subsurface of the parent surface and we can't create it before the parent is also created.

It should only exist, though. We shouldn't need to wait a frame - the spec doesn't even seem to require the parent to be configured. I should look into when Gtk actually creates the surface...

It's a bit annoying to have to delay execution of these things, but reducing get to a simple accessor and keeping all the creation logic separate would probably still be nice.

Sure, we can reiterate that again and try to make it work.

  • moz_container_wayland_get_surface() is replaced by moz_container_wayland_surface_lock()/moz_container_wayland_surface_unlock()
    pair which ensures the surface is locked and won't be destroyed by other thread when window is hidden for instance.

  • nsWindow::GetWaylandSurface() is removed and nsWindow::GetMozContainer() needs to be used instead.

Assignee: nobody → stransky
Status: NEW → ASSIGNED
Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9b17e776c117
[Wayland] Always lock wayland surface when se use it, r=jhorak
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Regressions: 1643149
Crash Signature: [@ wl_proxy_marshal_array_constructor_versioned | <name omitted> | mozilla::widget::WindowBackBuffer::Attach] [@ wl_proxy_marshal_array_constructor_versioned | wl_proxy_marshal | mozilla::widget::WindowBackBuffer::Attach] [@ wl_proxy_marshal_array_constru…
Crash Signature: wl_proxy_marshal_array_constructor_versioned | wl_proxy_marshal_constructor | mozilla::widget::WindowSurfaceWayland::CommitWaylandBuffer] → wl_proxy_marshal_array_constructor_versioned | wl_proxy_marshal_constructor | mozilla::widget::WindowSurfaceWayland::CommitWaylandBuffer] [@ wl_proxy_marshal_array_constructor_versioned | <name omitted> | libxul.so@0x1ed20e9 | __pthread_mutex_lock | fire…
Crash Signature: firefox@0x4941b] → firefox@0x4941b] [@ wl_proxy_marshal_constructor | moz_container_wayland_request_parent_frame_callback]
Crash Signature: firefox@0x4941b] [@ wl_proxy_marshal_constructor | moz_container_wayland_request_parent_frame_callback] → firefox@0x4941b] [@ wl_proxy_marshal_constructor | moz_container_wayland_request_parent_frame_callback] [@ libwayland-client.so.0.3.0 (deleted)@0x7541]
Crash Signature: firefox@0x4941b] [@ wl_proxy_marshal_constructor | moz_container_wayland_request_parent_frame_callback] [@ libwayland-client.so.0.3.0 (deleted)@0x7541] → firefox@0x4941b] [@ wl_proxy_marshal_constructor | moz_container_wayland_request_parent_frame_callback] [@ libwayland-client.so.0.3.0 (deleted)@0x7541] [@ libwayland-client.so.0@0x435b]
See Also: → 1655282
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: