|
|
9ae3a8 |
From 2f0eb4848baaa020132d5848a5d05e9db55fb15c Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 8 Feb 2018 17:50:24 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 10/27] vnc: add vnc_width+vnc_height helpers
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20180208175041.5634-11-berrange@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78943
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v1 10/27] vnc: add vnc_width+vnc_height helpers
|
|
|
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-12-git-send-email-kraxel@redhat.com
|
|
|
9ae3a8 |
(cherry picked from commit d05959c2e111858bb83c40ae5d8b8c10964b7bb0)
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
ui/vnc.c | 16 +++++++++++++---
|
|
|
9ae3a8 |
1 file changed, 13 insertions(+), 3 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/ui/vnc.c b/ui/vnc.c
|
|
|
9ae3a8 |
index 9923d24..c3f29df 100644
|
|
|
9ae3a8 |
--- a/ui/vnc.c
|
|
|
9ae3a8 |
+++ b/ui/vnc.c
|
|
|
9ae3a8 |
@@ -426,6 +426,17 @@ static void framebuffer_update_request(VncState *vs, int incremental,
|
|
|
9ae3a8 |
static void vnc_refresh(DisplayChangeListener *dcl);
|
|
|
9ae3a8 |
static int vnc_refresh_server_surface(VncDisplay *vd);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+static int vnc_width(VncDisplay *vd)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ return MIN(VNC_MAX_WIDTH, ROUND_UP(surface_width(vd->ds),
|
|
|
9ae3a8 |
+ VNC_DIRTY_PIXELS_PER_BIT));
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+static int vnc_height(VncDisplay *vd)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ return MIN(VNC_MAX_HEIGHT, surface_height(vd->ds));
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
static void vnc_set_area_dirty(DECLARE_BITMAP(dirty[VNC_MAX_HEIGHT],
|
|
|
9ae3a8 |
VNC_MAX_WIDTH / VNC_DIRTY_PIXELS_PER_BIT),
|
|
|
9ae3a8 |
int width, int height,
|
|
|
9ae3a8 |
@@ -614,9 +625,8 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
|
|
|
9ae3a8 |
/* server surface */
|
|
|
9ae3a8 |
qemu_pixman_image_unref(vd->server);
|
|
|
9ae3a8 |
vd->ds = surface;
|
|
|
9ae3a8 |
- width = MIN(VNC_MAX_WIDTH, ROUND_UP(surface_width(vd->ds),
|
|
|
9ae3a8 |
- VNC_DIRTY_PIXELS_PER_BIT));
|
|
|
9ae3a8 |
- height = MIN(VNC_MAX_HEIGHT, surface_height(vd->ds));
|
|
|
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 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|