• Daniel Stone's avatar
    egl/wayland: Ensure we get a back buffer · 8008bc8c
    Daniel Stone authored
    Commit 9ca6711f changed the Wayland winsys to only block for the
    frame callback inside SwapBuffers, rather than get_back_bo. get_back_bo
    would perform a single non-blocking Wayland event dispatch, to try to
    find any release events which we had pulled off the wire but not
    actually processed. The blocking dispatch was moved to SwapBuffers.
    
    This removed a guarantee that we would've processed all events inside
    get_back_bo(), and introduced a failure whereby the server could've sent
    a buffer release event, but we wouldn't have read it. In clients
    unconstrained by SwapInterval (rendering ~as fast as possible), which
    were being displayed directly without composition (buffer release delayed),
    this could lead to get_back_bo() failing because there were no free
    buffers available to it.
    
    The drawing rightly failed, but this was papered over because of the
    path in eglSwapBuffers() which attempts to guarantee a BO, in order to
    support calling SwapBuffers twice in a row with no rendering actually
    having been performed.
    
    Since eglSwapBuffers will perform a blocking dispatch of Wayland
    events, a buffer release would have arrived by that point, and we
    could then choose a buffer to post to the server. The effect was that
    frames were displayed out-of-order, since we grabbed a frame with random
    past content to display to the compositor.
    
    Ideally get_back_bo() failing should store a failure flag inside the
    surface and cause the next SwapBuffers to fail, but for the meantime,
    restore the correct behaviour such that get_back_bo() no longer fails.
    Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
    Reported-by: Eero Tamminen's avatarEero Tamminen <eero.t.tamminen@intel.com>
    Acked-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98833
    Fixes: 9ca6711f ("Revert "wayland: Block for the frame callback in get_back_bo not dri2_swap_buffers"")
    (cherry picked from commit 1f2d0093)
    8008bc8c
Name
Last commit
Last update
bin Loading commit data...
docs Loading commit data...
doxygen Loading commit data...
include Loading commit data...
m4 Loading commit data...
scons Loading commit data...
scripts Loading commit data...
src Loading commit data...
.dir-locals.el Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
Android.common.mk Loading commit data...
Android.mk Loading commit data...
CleanSpec.mk Loading commit data...
Makefile.am Loading commit data...
REVIEWERS Loading commit data...
SConstruct Loading commit data...
VERSION Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
common.py Loading commit data...
configure.ac Loading commit data...
install-gallium-links.mk Loading commit data...
install-lib-links.mk Loading commit data...