[Wayland-bugs] [Bug 763852] gdk/wayland: event source is not multi-thread aware

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Fri Mar 18 14:12:44 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=763852

--- Comment #7 from Matthew Waters (ystreet00) <ystreet00 at gmail.com> ---
(In reply to Matthias Clasen from comment #6)
> How is this relevant to GTK+s use of libwayland ? How do you end up with
> multiple threads sharing the wayland socket that GDK is using ?

EGL and/or GStreamer and/or possibly Vulkan.

1. mesa internally creates a wl_event_queue for all it's winsys operations and
polls/dispatches that as necessary from the calling thread.  The moment one
performs EGL operations off the main thread, you're prone to deadlocks. 
gtkglarea itself isn't affected because everything is performed on the main
thread.

2. GStreamer both with or without OpenGL/EGL - The GStreamer elements
waylandsink (using subsurfaces), glimagesink (using subsurfaces and EGL), or
gtkglsink (using EGL) have their own rendering threads and OpenGL contexts that
they're manipulating off the main thread which will poll and dispatch the
wayland fd.

Side note, we have to do a similar thing on X11 in GStreamer's gtkglsink (at
the very least on Intel hardware) as sharing OpenGL contexts does not work
across multiple X11 display connections like it does on some other
hardware/drivers.  Using XReparentWindow works across X11 display connections
but produces rendering artifacts when resizing.  gtkglsink doesn't have these
artifacts as the frame updates are integrated into Gtk+'s draw cycle.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20160318/ab103508/attachment.html>


More information about the wayland-bugs mailing list