From 87ca1bdf6935c4b11b41ca071f1f4b8d8347fee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 3 Dec 2019 18:39:40 +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 (Cherry picked from commit 2a2234ad1a0fe88400c1511fea67741e4ad09f7f) Reviewed-by: Kenneth Graunke --- 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 2937d9c97..31c276623 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -24,6 +24,7 @@ */ #include "xwayland.h" +#include "glamor.h" #include @@ -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