From 2a2234ad1a0fe88400c1511fea67741e4ad09f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 29 Nov 2019 09:40:13 +0100 Subject: [PATCH] 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 --- hw/xwayland/xwayland-present.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 7f0b951ab..cfcf284af 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -24,6 +24,7 @@ */ #include "xwayland.h" +#include "glamor.h" #include @@ -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