|
|
9ae3a8 |
From bb6e65d667f1bbc28cfab0ba2626880cee8e7741 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 8 Feb 2018 17:50:33 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 19/27] ui: introduce enum to track VNC client framebuffer
|
|
|
9ae3a8 |
update request state
|
|
|
9ae3a8 |
MIME-Version: 1.0
|
|
|
9ae3a8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9ae3a8 |
Content-Transfer-Encoding: 8bit
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20180208175041.5634-20-berrange@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78953
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v1 19/27] ui: introduce enum to track VNC client framebuffer update request state
|
|
|
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: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Currently the VNC servers tracks whether a client has requested an incremental
|
|
|
9ae3a8 |
or forced update with two boolean flags. There are only really 3 distinct
|
|
|
9ae3a8 |
states to track, so create an enum to more accurately reflect permitted states.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
|
|
|
9ae3a8 |
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Message-id: 20171218191228.31018-7-berrange@redhat.com
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit fef1bbadfb2c3027208eb3d14b43e1bdb51166ca)
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
ui/vnc.c | 21 +++++++++++----------
|
|
|
9ae3a8 |
ui/vnc.h | 9 +++++++--
|
|
|
9ae3a8 |
2 files changed, 18 insertions(+), 12 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/ui/vnc.c b/ui/vnc.c
|
|
|
9ae3a8 |
index eea5702..7239602 100644
|
|
|
9ae3a8 |
--- a/ui/vnc.c
|
|
|
9ae3a8 |
+++ b/ui/vnc.c
|
|
|
9ae3a8 |
@@ -860,16 +860,17 @@ static int vnc_update_client(VncState *vs, int has_dirty)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
vs->has_dirty += has_dirty;
|
|
|
9ae3a8 |
- if (!vs->need_update) {
|
|
|
9ae3a8 |
+ if (vs->update == VNC_STATE_UPDATE_NONE) {
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- if (vs->output.offset && !vs->audio_cap && !vs->force_update) {
|
|
|
9ae3a8 |
+ if (vs->output.offset && !vs->audio_cap &&
|
|
|
9ae3a8 |
+ vs->update != VNC_STATE_UPDATE_FORCE) {
|
|
|
9ae3a8 |
/* kernel send buffers are full -> drop frames to throttle */
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- if (!vs->has_dirty && !vs->force_update) {
|
|
|
9ae3a8 |
+ if (!vs->has_dirty && vs->update != VNC_STATE_UPDATE_FORCE) {
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -909,7 +910,7 @@ static int vnc_update_client(VncState *vs, int has_dirty)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
vnc_job_push(job);
|
|
|
9ae3a8 |
- vs->force_update = 0;
|
|
|
9ae3a8 |
+ vs->update = VNC_STATE_UPDATE_INCREMENTAL;
|
|
|
9ae3a8 |
vs->has_dirty = 0;
|
|
|
9ae3a8 |
return n;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1832,14 +1833,14 @@ static void ext_key_event(VncState *vs, int down,
|
|
|
9ae3a8 |
static void framebuffer_update_request(VncState *vs, int incremental,
|
|
|
9ae3a8 |
int x, int y, int w, int h)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- vs->need_update = 1;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
if (incremental) {
|
|
|
9ae3a8 |
- return;
|
|
|
9ae3a8 |
+ if (vs->update != VNC_STATE_UPDATE_FORCE) {
|
|
|
9ae3a8 |
+ vs->update = VNC_STATE_UPDATE_INCREMENTAL;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+ } else {
|
|
|
9ae3a8 |
+ vs->update = VNC_STATE_UPDATE_FORCE;
|
|
|
9ae3a8 |
+ vnc_set_area_dirty(vs->dirty, vs->vd, x, y, w, h);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- vs->force_update = 1;
|
|
|
9ae3a8 |
- vnc_set_area_dirty(vs->dirty, vs->vd, x, y, w, h);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static void send_ext_key_event_ack(VncState *vs)
|
|
|
9ae3a8 |
diff --git a/ui/vnc.h b/ui/vnc.h
|
|
|
9ae3a8 |
index d8465ba..f19fd0a 100644
|
|
|
9ae3a8 |
--- a/ui/vnc.h
|
|
|
9ae3a8 |
+++ b/ui/vnc.h
|
|
|
9ae3a8 |
@@ -252,6 +252,12 @@ struct VncJob
|
|
|
9ae3a8 |
QTAILQ_ENTRY(VncJob) next;
|
|
|
9ae3a8 |
};
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+typedef enum {
|
|
|
9ae3a8 |
+ VNC_STATE_UPDATE_NONE,
|
|
|
9ae3a8 |
+ VNC_STATE_UPDATE_INCREMENTAL,
|
|
|
9ae3a8 |
+ VNC_STATE_UPDATE_FORCE,
|
|
|
9ae3a8 |
+} VncStateUpdate;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
struct VncState
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
int csock;
|
|
|
9ae3a8 |
@@ -261,8 +267,7 @@ struct VncState
|
|
|
9ae3a8 |
* vnc-jobs-async.c */
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
VncDisplay *vd;
|
|
|
9ae3a8 |
- int need_update;
|
|
|
9ae3a8 |
- int force_update;
|
|
|
9ae3a8 |
+ VncStateUpdate update; /* Most recent pending request from client */
|
|
|
9ae3a8 |
int has_dirty;
|
|
|
9ae3a8 |
uint32_t features;
|
|
|
9ae3a8 |
int absolute;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|