Bug 65427 - Gallium EGL on Wayland blocks in eglInitialize (no display thread bound)
Summary: Gallium EGL on Wayland blocks in eglInitialize (no display thread bound)
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-05 17:17 UTC by Jay Cornwall
Modified: 2018-05-01 19:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Potential fix for Gallium EGL Wayland protocol (562 bytes, text/plain)
2013-06-05 17:17 UTC, Jay Cornwall
Details
Trivial test case for Gallium EGL Wayland backend (119 bytes, text/plain)
2013-06-05 17:18 UTC, Jay Cornwall
Details

Description Jay Cornwall 2013-06-05 17:17:42 UTC
Created attachment 80361 [details]
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.
Comment 1 Jay Cornwall 2013-06-05 17:18:21 UTC
Created attachment 80362 [details]
Trivial test case for Gallium EGL Wayland backend
Comment 2 Timothy Arceri 2018-05-01 19:36:51 UTC
The EGL state tracker was dropped from Mesa long ago. Closing.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.