qemu/0040-vnc-update-fix.patch

66 lines
2.1 KiB
Diff

From 6fc52b247a1e6ff8870ea5e826ceab01983b8b90 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 23 Jul 2014 11:52:02 +0200
Subject: [PATCH] vnc update fix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We need to remember has_updates for each vnc client. Otherwise it might
happen that vnc_update_client(has_dirty=1) takes the first exit due to
output buffers not being flushed yet and subsequent calls with
has_dirty=0 take the second exit, wrongly assuming there is nothing to
do because the work defered in the first call is ignored.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
(cherry picked from commit 6365828003c8e88bff67d351af4b66c406568a26)
[AF: Relates to BNC#888142]
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
ui/vnc.c | 4 +++-
ui/vnc.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 75dd0a1..48e6591 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -888,6 +888,7 @@ static int find_and_clear_dirty_height(struct VncState *vs,
static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
{
+ vs->has_dirty += has_dirty;
if (vs->need_update && vs->csock != -1) {
VncDisplay *vd = vs->vd;
VncJob *job;
@@ -899,7 +900,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
/* kernel send buffers are full -> drop frames to throttle */
return 0;
- if (!has_dirty && !vs->audio_cap && !vs->force_update)
+ if (!vs->has_dirty && !vs->audio_cap && !vs->force_update)
return 0;
/*
@@ -942,6 +943,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
vnc_jobs_join(vs);
}
vs->force_update = 0;
+ vs->has_dirty = 0;
return n;
}
diff --git a/ui/vnc.h b/ui/vnc.h
index 8f582fd..334de9d 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -263,6 +263,7 @@ struct VncState
VncDisplay *vd;
int need_update;
int force_update;
+ int has_dirty;
uint32_t features;
int absolute;
int last_x;