Closed Bug 1829303 Opened 1 year ago Closed 1 year ago

[Wayland] Remove thread specific wayland display objects

Categories

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

task

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

Details

Attachments

(1 file)

Thread specific wayland display objects were created on wrong premise that we need different global objects for each thread.

That's not correct, we can use the same objects in different threads and use default queue for it. Only problem is that all events will be handled by main thread event loop so all threads will depend on main loop to get wayland events.

But that's recent state anyway, we get all wayland events in nsAppShell::ProcessNextNativeEvent() and then call mozilla::widget::WaylandDispatchDisplays() so we're distribute all events together.

To create correct multi-thread model (if we need to) we have to:

  • create proxy wayland display connection for every thread with its own queue
  • create proxy wayland surface for every thread with its own queue
  • distribute events to them

That may useful for multi-thread rendering but we don't do that AFAIK. We just render/paint in compositor thread. From my testing there's no rendering speed regression when single display is used.

Priority: -- → P3
  • Remove nsWaylandDisplay thread specific objects as we don't need them.
  • Use nsWaylandDisplay as non-referenced objects. There's only a global one.
  • Create nsWaylandDisplay global object in nsAppRunner when Firefox starts. That ensures we create it in main thread.
  • Remove mEventQueue, we don't need it.
  • Remove mSyncCallback, it's unused.

wl_proxy_marshal_array_flags() which is backend operation for all wayland protocol calls uses pthread_mutex_lock(&disp->mutex) so we can use it in multi thread scenario where we access to one client proxy from different threads (if that's even necessary).

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/90256c29ed1f
[Wayland] Remove thread specific wayland display objects r=emilio
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Type: enhancement → task
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 114 Branch → ---
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/f38219ee2b39
[Wayland] Remove thread specific wayland display objects r=emilio
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Duplicate of this bug: 1828077
See Also: → 1795561
Duplicate of this bug: 1828618
See Also: → 1795784
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: