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>
(Cherry picked from commit 2a2234ad1a)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Michel Dänzer 2019-12-03 18:39:40 +01:00 committed by Kenneth Graunke
parent 8aad09dd79
commit 87ca1bdf69

View File

@ -24,6 +24,7 @@
*/
#include "xwayland.h"
#include "glamor.h"
#include <present.h>
@ -412,9 +413,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