From patchwork Thu Jul 26 22:59:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev\" via" X-Patchwork-Id: 10546517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F22A314BC for ; Thu, 26 Jul 2018 22:59:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E443C2BD0A for ; Thu, 26 Jul 2018 22:59:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D86D92BD0C; Thu, 26 Jul 2018 22:59:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 665CB2BD0A for ; Thu, 26 Jul 2018 22:59:57 +0000 (UTC) Received: from localhost ([::1]:38349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fipEh-0008TL-Kl for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 Jul 2018 18:59:55 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MATPVr6emfSbiwk0lAoLwTSlfAgFIm4LLq2QGVV/sxo=; b=p17ndBbwzPdiWLnle+YPZIs5dJaVXYykhlYEi/PnTEKqSjndWs9mgjcJrk2JCwqxpf UGX8QZK0NLu4p9qpAH14XbelkDfwWTnhPeJrcGrOUgi4IIgtRZoGPkeGy/vbfJjxU0M9 En+8k392F0zazcI120IfvK2Ly2pUSq5uvKGG/UmR41U228MsyJZ48xMREwSXZC5IH7eu 39Bx00l+DJ3rHMjdPMuhpRPizbXdOLdt9uVMmaUQNyC/m6cITKI7d9GDcWjczrqwRsS5 IfidVsePFEKKj4JqquLdxzfD5GwGTfVrJpfYsyYi6Ih5etx3x86g1uyq6Ar35p/nGwep sbOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MATPVr6emfSbiwk0lAoLwTSlfAgFIm4LLq2QGVV/sxo=; b=KiMEroTDuay7c8LGBV8IW9KxS4YcLvYJml1qh82wst6ekqanOqIVXbwPJhxpPYegXf pc+l38qAieWMGocHZBpQYxURQBe8eb4J6LTBH0EQ6nY2meXMMkM81TOunr4GuEkCx/eN EIFqNY7e7WRnF0+V2pww5pBGw7Ff4Mg/CTZlh1ov9/nua2J0/fAZ8TkUmOU+it95B5f/ rTM/67KfxCg48Rn09Vq8yXX4hTdR88UMUwymPqXg+dM9ZAibAv8d9ikhJ2kRaA4CGN0I 0q/ixhmilZ4zVo4RnU8QS1JzR0Y1RY3pn47sqGOh1S08h8tkwViBQIlcoG60WBjlJUsf c8hQ== X-Gm-Message-State: AOUpUlFGg5A+W+ij4POCJCkXOXBqGtetRttYOkbTvtwNxZQesP3HLYiD Rk/IZtqqcCH+hlGN+LPI3hJCUA== X-Google-Smtp-Source: AAOMgpfyr+PYqoIqbLBR2fDNVaoFxlvNzX0HGFUwWDmnw6gKSX3awVzPDG6X1sboLvCe2/xszJ2reQ== X-Received: by 2002:a63:7e1a:: with SMTP id z26-v6mr3663094pgc.278.1532645947753; Thu, 26 Jul 2018 15:59:07 -0700 (PDT) Received: from paxos.mtv.corp.google.com ([2620:0:1000:1511:173b:3dd2:5b8:5730]) by smtp.gmail.com with ESMTPSA id k12-v6sm3961170pfj.30.2018.07.26.15.59.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Jul 2018 15:59:07 -0700 (PDT) To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Thu, 26 Jul 2018 15:59:00 -0700 Message-Id: <20180726225900.180698-1-lepton@google.com> X-Mailer: git-send-email 2.18.0.345.g5c9ce644c3-goog MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [PATCH] sdl2: redraw correctly when scanout_mode enabled. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tao Wu via Qemu-devel From: "Denis V. Lunev\" via" Reply-To: Tao Wu Cc: Tao Wu Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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); }