From patchwork Thu Nov 1 12:24:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 196184 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E8382C0339 for ; Thu, 1 Nov 2012 23:25:10 +1100 (EST) Received: from localhost ([::1]:59690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTtpa-0006WG-5s for incoming@patchwork.ozlabs.org; Thu, 01 Nov 2012 08:25:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTtpT-0006Vl-F7 for qemu-devel@nongnu.org; Thu, 01 Nov 2012 08:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTtpS-0004IK-Go for qemu-devel@nongnu.org; Thu, 01 Nov 2012 08:24:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTtpS-0004HV-87 for qemu-devel@nongnu.org; Thu, 01 Nov 2012 08:24:58 -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 qA1COviV013459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Nov 2012 08:24:57 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qA1COuRV010414; Thu, 1 Nov 2012 08:24:57 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id DDD9B41E31; Thu, 1 Nov 2012 13:24:55 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 1 Nov 2012 13:24:55 +0100 Message-Id: <1351772695-30404-1-git-send-email-kraxel@redhat.com> 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 Subject: [Qemu-devel] [PATCH] qxl: make sure we don't have a stale ds_mirror hanging around 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 ui/spice-display.c uses ds_mirror to figure which screen areas did actually change. This is active when the qxl card is in vga mode or a non-qxl gfx card is used. A display resize invalidates ds_mirror, and it is handled by simply simply freeing ds_mirror. The next screen update it will be re-allocated as needed. With qxl there is another possible code path which can invalidate ds_mirror: leave vga mode and re-enter vga mode. Make sure we free ds_mirror here too. https://bugzilla.redhat.com/show_bug.cgi?id=865767 Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index dfb221a..f25c89d 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1070,6 +1070,8 @@ static void qxl_enter_vga_mode(PCIQXLDevice *d) qemu_spice_create_host_primary(&d->ssd); d->mode = QXL_MODE_VGA; memset(&d->ssd.dirty, 0, sizeof(d->ssd.dirty)); + g_free(d->ssd.ds_mirror); + d->ssd.ds_mirror = NULL; vga_dirty_log_start(&d->vga); }