xwayland: Do flush GPU work in xwl_present_flush

The Present code sends the idle notification event to the client after
xwl_present_flush returns. If we don't flush our GPU work here, the
client may race to draw another frame to the same buffer, so we may end
up copying (parts of) that new frame instead of the one we meant to.

Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/835

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
Michel Dänzer 2019-11-29 09:40:13 +01:00 committed by Michel Dänzer
parent cd999f08c6
commit 2a2234ad1a

View File

@ -24,6 +24,7 @@
*/
#include "xwayland.h"
#include "glamor.h"
#include <present.h>
@ -409,9 +410,7 @@ xwl_present_abort_vblank(WindowPtr present_window,
static void
xwl_present_flush(WindowPtr window)
{
/* Only called when a Pixmap is copied instead of flipped,
* but in this case we wait on the next block_handler.
*/
glamor_block_handler(window->drawable.pScreen);
}
static Bool