From patchwork Wed Feb 15 13:11:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 141317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E24B2B6FF0 for ; Thu, 16 Feb 2012 00:41:33 +1100 (EST) Received: from localhost ([::1]:51905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxedz-0006qv-Mp for incoming@patchwork.ozlabs.org; Wed, 15 Feb 2012 08:11:35 -0500 Received: from eggs.gnu.org ([140.186.70.92]:48283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxedi-0006CO-AZ for qemu-devel@nongnu.org; Wed, 15 Feb 2012 08:11:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rxeda-0006kG-7Z for qemu-devel@nongnu.org; Wed, 15 Feb 2012 08:11:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxeda-0006kB-0r for qemu-devel@nongnu.org; Wed, 15 Feb 2012 08:11:10 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1FDB9Hs029557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Feb 2012 08:11:09 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1FDB80x021626; Wed, 15 Feb 2012 08:11:08 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 18B1241101; Wed, 15 Feb 2012 14:11:06 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 15 Feb 2012 14:11:06 +0100 Message-Id: <1329311466-20344-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: yhalperi@redhat.com, Gerd Hoffmann Subject: [Qemu-devel] [PATCH] qxl: don't render stuff when the vm is stopped. 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 This patch fixes the local qxl renderer to not kick spice-server in case the vm is stopped. First it is pointless because we render evevything when the vm is stopped. Thus there is nothing to render anyway because a stopped guest can hardly queue more commands. Second we avoid triggering an assert in spice-server. With this patch applied it is possible to take screen shots (via screendump monitor command) from a qxl gpu even in case the guest is stopped. Signed-off-by: Gerd Hoffmann --- hw/qxl-render.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/qxl-render.c b/hw/qxl-render.c index 133d093..7084143 100644 --- a/hw/qxl-render.c +++ b/hw/qxl-render.c @@ -121,19 +121,17 @@ void qxl_render_update(PCIQXLDevice *qxl) dpy_resize(vga->ds); } - if (!qxl->guest_primary.commands) { - return; - } - qxl->guest_primary.commands = 0; - update.left = 0; update.right = qxl->guest_primary.surface.width; update.top = 0; update.bottom = qxl->guest_primary.surface.height; memset(dirty, 0, sizeof(dirty)); - qxl_spice_update_area(qxl, 0, &update, - dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC); + if (runstate_is_running() && qxl->guest_primary.commands) { + qxl->guest_primary.commands = 0; + qxl_spice_update_area(qxl, 0, &update, + dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC); + } if (redraw) { memset(dirty, 0, sizeof(dirty)); dirty[0] = update;