From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIgJ1-0007du-Fd for qemu-devel@nongnu.org; Tue, 25 Oct 2011 08:40:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIgIv-0003V9-94 for qemu-devel@nongnu.org; Tue, 25 Oct 2011 08:40:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIgIv-0003Us-1w for qemu-devel@nongnu.org; Tue, 25 Oct 2011 08:40:29 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9PCeSgT013854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 Oct 2011 08:40:28 -0400 From: Gerd Hoffmann Date: Tue, 25 Oct 2011 14:34:33 +0200 Message-Id: <1319546073-25024-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1319546073-25024-1-git-send-email-kraxel@redhat.com> References: <1319546073-25024-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] qxl: make sure we continue to run with a shared buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann The qxl renderer works only with a shared displaysurface. So better make sure we actually have one and restore it when needed. Signed-off-by: Gerd Hoffmann --- hw/qxl-render.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/hw/qxl-render.c b/hw/qxl-render.c index a567693..2c51ba9 100644 --- a/hw/qxl-render.c +++ b/hw/qxl-render.c @@ -76,7 +76,14 @@ void qxl_render_update(PCIQXLDevice *qxl) VGACommonState *vga = &qxl->vga; QXLRect dirty[32], update; void *ptr; - int i; + int i, redraw = 0; + + if (!is_buffer_shared(vga->ds->surface)) { + dprint(qxl, 1, "%s: restoring shared displaysurface\n", __func__); + qxl->guest_primary.resized++; + qxl->guest_primary.commands++; + redraw = 1; + } if (qxl->guest_primary.resized) { qxl->guest_primary.resized = 0; @@ -127,6 +134,10 @@ void qxl_render_update(PCIQXLDevice *qxl) memset(dirty, 0, sizeof(dirty)); qxl_spice_update_area(qxl, 0, &update, dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC); + if (redraw) { + memset(dirty, 0, sizeof(dirty)); + dirty[0] = update; + } for (i = 0; i < ARRAY_SIZE(dirty); i++) { if (qemu_spice_rect_is_empty(dirty+i)) { -- 1.7.1