mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
egl/wayland: Use roundtrips when awaiting buffer release
In get_back_bo, we use wl_display_dispatch_queue() to block and wait for a buffer release event. However, not all Wayland compositors flush the client socket on posting a buffer-release event, so by only blocking client-side, we may block indefinitely, or at least need to wait for an input event / frame completion to arrive for the compositor to flush. We now use dispatch_queue as a first pass, but if our entire buffer pool is exhausted, use a roundtrip (an immediately-triggered wl_callback) to ensure that the compositor flushes out our release event immediately. [daniels: Modified comment and commit message.] Signed-off-by: Kai Chen <kai.chen@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com> CC: <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
4da6cf6c98
commit
151188d1e3
1 changed files with 7 additions and 2 deletions
|
|
@ -383,8 +383,13 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
|
|||
break;
|
||||
|
||||
/* If we don't have a buffer, then block on the server to release one for
|
||||
* us, and try again. */
|
||||
if (wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_surf->wl_queue) < 0)
|
||||
* us, and try again. wl_display_dispatch_queue will process any pending
|
||||
* events, however not all servers flush on issuing a buffer release
|
||||
* event. So, we spam the server with roundtrips as they always cause a
|
||||
* client flush.
|
||||
*/
|
||||
if (wl_display_roundtrip_queue(dri2_dpy->wl_dpy,
|
||||
dri2_surf->wl_queue) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue