From c0c0851558776cc72b488b0c855487f2025363b5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 14 Feb 2012 15:28:16 +0100 Subject: [PATCH 2/4] qxl: make sure we continue to run with a shared buffer RH-Author: Gerd Hoffmann Message-id: <1329233296-19360-3-git-send-email-kraxel@redhat.com> Patchwork-id: 37293 O-Subject: [RHEL-6.3 qemu-kvm PATCH 2/2] qxl: make sure we continue to run with a shared buffer Bugzilla: 748810 RH-Acked-by: Laszlo Ersek RH-Acked-by: Alon Levy RH-Acked-by: Hans de Goede 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 (cherry picked from commit a053f1b1fb63cb57483354db7b154e9a2e585b5a) --- hw/qxl-render.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) Signed-off-by: Michal Novotny --- 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 fa7977a..69e81fd 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; @@ -126,6 +133,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.7.5