[Mesa-dev] [Bug 65427] New: Gallium EGL on Wayland blocks in eglInitialize (no display thread bound)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jun 5 10:17:42 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=65427

          Priority: medium
            Bug ID: 65427
          Assignee: mesa-dev at lists.freedesktop.org
           Summary: Gallium EGL on Wayland blocks in eglInitialize (no
                    display thread bound)
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: jay at jcornwall.me
          Hardware: Other
            Status: NEW
           Version: git
         Component: Other
           Product: Mesa

Created attachment 80361
  --> https://bugs.freedesktop.org/attachment.cgi?id=80361&action=edit
Potential fix for Gallium EGL Wayland protocol

wayland_drm_display_init_screen (via wayland_roundtrip) blocks indefinitely in
wl_display_dispatch_queue. The man page explains this behavior:

[A user created queue is dispatched with wl_display_dispatch_queue(). If there
are no events to dispatch this function will block. If this is called by the
main thread, this will attempt to read data from the display fd and queue any
events on the appropriate queues. If calling from any other thread, the
function will block until the main thread queues an event on the queue being
dispatched.]

The calling thread is not identified by libwayland-client as the "main thread".
The protocol used in Wayland test programs is to call
wl_display_dispatch_pending() prior to this point, which sets the calling
thread as the "main thread". See attached patch and test case.

While this fixes the test case (and all EGL calls for a single-threaded
application), this problem may also affect other calls, e.g. eglSwapBuffers(),
which is specified to be callable from different threads. The same
wl_display_dispatch_queue() call could be introduced into this path (rebinding
the "main thread" with each call), but the overhead of doing so has not been
measured.

It may be preferable to do this in wayland_roundtrip() or to consider a change
in Wayland itself.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130605/94a42e42/attachment-0001.html>


More information about the mesa-dev mailing list