OSDN Git Service

egl/wayland: Use roundtrips when awaiting buffer release
authorKai Chen <kai.chen@intel.com>
Mon, 7 Aug 2017 15:34:51 +0000 (08:34 -0700)
committerAndres Gomez <agomez@igalia.com>
Fri, 25 Aug 2017 13:03:37 +0000 (16:03 +0300)
commit81a1ecda15bba5d16812226ffafe60f36f2ac21e
tree6719990e0d3556347a5b1db1e615332c1940670b
parent52b0ad8666b4f9c4acd206ae231b62ee1b91561b
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>
(cherry picked from commit 151188d1e330a7a5f110bbc8251680121a1a84a6)
src/egl/drivers/dri2/platform_wayland.c