]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
qxl: make sure we continue to run with a shared buffer
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 21 Oct 2011 19:53:54 +0000 (21:53 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 1 Nov 2011 11:11:53 +0000 (12:11 +0100)
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 <kraxel@redhat.com>
hw/qxl-render.c

index a5676938a8345ae310faab124ea133c7c537798c..2c51ba9806d6eaa20dfed725d2eb95ccc6a7a130 100644 (file)
@@ -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)) {