From patchwork Thu Apr 24 17:20:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 342642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 30C1D1400D4 for ; Fri, 25 Apr 2014 14:35:21 +1000 (EST) Received: from localhost ([::1]:55656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdXr4-000353-QA for incoming@patchwork.ozlabs.org; Fri, 25 Apr 2014 00:35:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUcw-0001Ju-42 for qemu-devel@nongnu.org; Thu, 24 Apr 2014 21:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdNKP-0004yR-A9 for qemu-devel@nongnu.org; Thu, 24 Apr 2014 13:20:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdNKP-0004yI-2X for qemu-devel@nongnu.org; Thu, 24 Apr 2014 13:20:53 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3OHKqCh008666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 Apr 2014 13:20:52 -0400 Received: from colepc.home.com (ovpn-113-145.phx2.redhat.com [10.3.113.145]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s3OHKpMu025573; Thu, 24 Apr 2014 13:20:51 -0400 From: Cole Robinson To: qemu-devel@nongnu.org Date: Thu, 24 Apr 2014 13:20:44 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann , Cole Robinson Subject: [Qemu-devel] [PATCH] qxl: Fix initial screenshot with spice X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 1) Start an f20 VM with -device qxl-vga + spice, connect with remote-viewer 2) Wait till it boots to gdm 3) (qemu) screendump foo.ppm 4) (qemu) screendump bar.ppm foo.ppm will actually show the last screen contents before the VM switched out of VGA mode (right before switching to plymouth). bar.ppm will show the correct contents. The root issue is that the DisplaySurface tracked in QemuConsole is out of date, once qxl transitions out of vga mode nothing calls qxl_render_update which would update the console surface. ui/console.c:qmp_screendump attempts to handle this by calling graphic_hw_update, but qxl handle's that asynchronously, and it isn't run until after the first screendump is performed. That's why the second screendump is correct. Fix this by triggering qxl_render_update whenever a non-vga surface is created. Signed-off-by: Cole Robinson --- All that said, I'm not sure if this is the correct solution, maybe something else should be responsible for kicking qxl_render_update, yet isn't. hw/display/qxl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 47bbf1f..8d3645f 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1355,6 +1355,7 @@ static void qxl_create_guest_primary_complete(PCIQXLDevice *qxl) { /* for local rendering */ qxl_render_resize(qxl); + qxl_render_update(qxl); } static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm,