|
|
9ae3a8 |
From cf12dd3eb8a9c18fbccbe01cfcf8290d483becee Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 8 Feb 2018 17:50:25 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 11/27] vnc: factor out vnc_update_server_surface
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20180208175041.5634-12-berrange@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78952
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v1 11/27] vnc: factor out vnc_update_server_surface
|
|
|
9ae3a8 |
Bugzilla: 1527405
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Peter Lieven <pl@kamp.de>
|
|
|
9ae3a8 |
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
9ae3a8 |
Message-id: 1446203414-4013-13-git-send-email-kraxel@redhat.com
|
|
|
9ae3a8 |
(cherry picked from commit 453f842bc4cab49f10c267cff9ad3cf657265d49)
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
ui/vnc.c | 21 +++++++++++++++------
|
|
|
9ae3a8 |
1 file changed, 15 insertions(+), 6 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/ui/vnc.c b/ui/vnc.c
|
|
|
9ae3a8 |
index c3f29df..38e0f1a 100644
|
|
|
9ae3a8 |
--- a/ui/vnc.c
|
|
|
9ae3a8 |
+++ b/ui/vnc.c
|
|
|
9ae3a8 |
@@ -613,6 +613,17 @@ void *vnc_server_fb_ptr(VncDisplay *vd, int x, int y)
|
|
|
9ae3a8 |
return ptr;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+static void vnc_update_server_surface(VncDisplay *vd)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ qemu_pixman_image_unref(vd->server);
|
|
|
9ae3a8 |
+ vd->server = NULL;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT,
|
|
|
9ae3a8 |
+ vnc_width(vd),
|
|
|
9ae3a8 |
+ vnc_height(vd),
|
|
|
9ae3a8 |
+ NULL, 0);
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
static void vnc_dpy_switch(DisplayChangeListener *dcl,
|
|
|
9ae3a8 |
DisplaySurface *surface)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
@@ -621,19 +632,17 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
|
|
|
9ae3a8 |
int width, height;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
vnc_abort_display_jobs(vd);
|
|
|
9ae3a8 |
+ vd->ds = surface;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* server surface */
|
|
|
9ae3a8 |
- qemu_pixman_image_unref(vd->server);
|
|
|
9ae3a8 |
- vd->ds = surface;
|
|
|
9ae3a8 |
- width = vnc_width(vd);
|
|
|
9ae3a8 |
- height = vnc_height(vd);
|
|
|
9ae3a8 |
- vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT,
|
|
|
9ae3a8 |
- width, height, NULL, 0);
|
|
|
9ae3a8 |
+ vnc_update_server_surface(vd);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* guest surface */
|
|
|
9ae3a8 |
qemu_pixman_image_unref(vd->guest.fb);
|
|
|
9ae3a8 |
vd->guest.fb = pixman_image_ref(surface->image);
|
|
|
9ae3a8 |
vd->guest.format = surface->format;
|
|
|
9ae3a8 |
+ width = vnc_width(vd);
|
|
|
9ae3a8 |
+ height = vnc_height(vd);
|
|
|
9ae3a8 |
memset(vd->guest.dirty, 0x00, sizeof(vd->guest.dirty));
|
|
|
9ae3a8 |
vnc_set_area_dirty(vd->guest.dirty, width, height, 0, 0,
|
|
|
9ae3a8 |
width, height);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|