Received: from eggs.gnu.org ([2001:4830:134:3::10]:51893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fipDz-0007kh-6j for qemu-devel@nongnu.org; Thu, 26 Jul 2018 18:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fipDy-00083H-7O for qemu-devel@nongnu.org; Thu, 26 Jul 2018 18:59:11 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:36816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fipDx-00080n-W0 for qemu-devel@nongnu.org; Thu, 26 Jul 2018 18:59:10 -0400 Received: by mail-pf1-x443.google.com with SMTP id d14-v6so1054692pfo.3 for ; Thu, 26 Jul 2018 15:59:09 -0700 (PDT) From: Tao Wu Date: Thu, 26 Jul 2018 15:59:00 -0700 Message-Id: <20180726225900.180698-1-lepton@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH] sdl2: redraw correctly when scanout_mode enabled. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kraxel@redhat.com Cc: Tao Wu When scanout_mode enabled, surface is out of sync with actual screen. In such case, we just call sdl2_gl_scanout_flush to do redraw. This fixes bug reported in https://lists.freedesktop.org/archives/virglrenderer-devel/2018-July/001330.html Signed-off-by: Tao Wu --- ui/sdl2-gl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index 83b71853d1..1bf4542d8d 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -124,6 +124,11 @@ void sdl2_gl_redraw(struct sdl2_console *scon) { assert(scon->opengl); + if (scon->scanout_mode) { + /* sdl2_gl_scanout_flush actually only care about + * the first argument. */ + return sdl2_gl_scanout_flush(&scon->dcl, 0, 0, 0, 0); + } if (scon->surface) { sdl2_gl_render_surface(scon); } -- 2.18.0.345.g5c9ce644c3-goog