From bfe43d1b39f23fc4f808ea8183f5d42abee77f20 Mon Sep 17 00:00:00 2001
Message-Id: <bfe43d1b39f23fc4f808ea8183f5d42abee77f20.1353591647.git.minovotn@redhat.com>
In-Reply-To: <1dc297bcb7aa8724f5115f44e391085ce543d79a.1353591647.git.minovotn@redhat.com>
References: <1dc297bcb7aa8724f5115f44e391085ce543d79a.1353591647.git.minovotn@redhat.com>
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 16 Nov 2012 15:03:13 +0100
Subject: [PATCH 2/3] qxl: call dpy_gfx_resize when entering vga mode

RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <1353078193-8733-1-git-send-email-kraxel@redhat.com>
Patchwork-id: 44262
O-Subject: [RHEL-6.4 qemu-kvm PATCH] qxl: call dpy_gfx_resize when entering vga mode
Bugzilla: 865767
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Vlad Yasevich <vyasevic@redhat.com>
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>

When entering vga mode the display size likely changes,
notify all displaychangelisteners about this.

Probably went unnoticed for a while as one if the first
things the guest does after leaving qxl native mode and
entering qxl vga mode is to set the vga video mode.  But
there is still a small window where qemu can operate on
stale data, leading to crashes now and then.

https://bugzilla.redhat.com/show_bug.cgi?id=865767

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit e32c25b5f2452c7fed4dbe8962f4a9f4831fbe24)

Conflicts:

	hw/qxl.c
---
 hw/qxl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 04f9dd8..074b0eb 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1010,7 +1010,7 @@ static void qxl_enter_vga_mode(PCIQXLDevice *d)
     trace_qxl_enter_vga_mode(d->id);
     qemu_spice_create_host_primary(&d->ssd);
     d->mode = QXL_MODE_VGA;
-    memset(&d->ssd.dirty, 0, sizeof(d->ssd.dirty));
+    dpy_resize(d->ssd.ds);
 }
 
 static void qxl_exit_vga_mode(PCIQXLDevice *d)
-- 
1.7.11.7

