[Wayland] Remove thread specific wayland display objects
Categories
(Core :: Widget: Gtk, task, P3)
Tracking
()
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.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
- 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.
Assignee | ||
Comment 2•1 year ago
|
||
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
Comment 4•1 year ago
|
||
bugherder |
Updated•1 year ago
|
Comment 5•1 year ago
|
||
Backed out https://hg.mozilla.org/mozilla-central/rev/d476215f7edbf0a28571d5059e85d8a32da679b9 for causing conflicts
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/f38219ee2b39 [Wayland] Remove thread specific wayland display objects r=emilio
Comment 7•1 year ago
|
||
bugherder |
Description
•