Commit 4049d8c6 authored by Erik Kurzinger's avatar Erik Kurzinger
Browse files

xwayland/eglstream: flush stream after eglSwapBuffers



When eglSwapBuffers inserts a new frame into a window's stream, there may be a
delay before the state of the consumer end of the stream is updated to reflect
this. If the subsequent wl_surface_attach, wl_surface_damage, wl_surface_commit
calls are received by the compositor before then, it will (typically) re-use
the previous frame acquired from the stream instead of the latest one.

This can leave the window displaying out-of-date contents, which might never be
updated thereafter.

To fix this, after calling eglSwapBuffers, xwl_glamor_eglstream_post_damage
should call eglStreamFlushNV. This call will block until it can be guaranteed
that the state of the consumer end of the stream has been updated to reflect
that a new frame is available.
Signed-off-by: Erik Kurzinger's avatarErik Kurzinger <ekurzinger@nvidia.com>
parent 012350e3
Pipeline #317739 failed with stages
in 2 minutes and 5 seconds
......@@ -775,6 +775,10 @@ xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
goto out;
}
/* block until stream state is updated on the compositor's side */
eglStreamFlushNV(xwl_screen->egl_display,
xwl_pixmap->stream);
if (!xwl_pixmap->wait_for_buffer_release) {
/* hang onto the pixmap until the compositor has released it */
pixmap->refcnt++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment