From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsmMQ-00020M-Fa for qemu-devel@nongnu.org; Thu, 23 Aug 2018 05:57:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsmMP-0006zC-8x for qemu-devel@nongnu.org; Thu, 23 Aug 2018 05:57:02 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47352 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsmMO-0006yK-V5 for qemu-devel@nongnu.org; Thu, 23 Aug 2018 05:57:01 -0400 From: Gerd Hoffmann Date: Thu, 23 Aug 2018 11:56:45 +0200 Message-Id: <20180823095653.14556-5-kraxel@redhat.com> In-Reply-To: <20180823095653.14556-1-kraxel@redhat.com> References: <20180823095653.14556-1-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 04/12] sdl2: redraw correctly when scanout_mode enabled. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: libvir-list@redhat.com, Gerd Hoffmann , Tao Wu From: 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 Message-id: 20180726225900.180698-1-lepton@google.com Signed-off-by: Gerd Hoffmann --- 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.9.3