This patch makes the vnc server code skip screen refreshes in case
there is data in the output buffer. This reduces the refresh rate to
throttle the bandwidth needed in case the network link is saturated.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6862
c046a42c-6fe2-441c-8c8c-
71466251a162
static void vnc_copy(VncState *vs, int src_x, int src_y, int dst_x, int dst_y, int w, int h)
{
static void vnc_copy(VncState *vs, int src_x, int src_y, int dst_x, int dst_y, int w, int h)
{
vnc_update_client(vs);
vnc_write_u8(vs, 0); /* msg id */
vnc_update_client(vs);
vnc_write_u8(vs, 0); /* msg id */
int saved_offset;
int has_dirty = 0;
int saved_offset;
int has_dirty = 0;
+ if (vs->output.offset && !vs->audio_cap && !vs->force_update) {
+ /* kernel send buffers are full -> drop frames to throttle */
+ qemu_mod_timer(vs->timer, qemu_get_clock(rt_clock) + VNC_REFRESH_INTERVAL);
+ return;
+ }
+
server_row += ds_get_linesize(vs->ds);
}
server_row += ds_get_linesize(vs->ds);
}
- if (!has_dirty && !vs->audio_cap) {
+ if (!has_dirty && !vs->audio_cap && !vs->force_update) {
qemu_mod_timer(vs->timer, qemu_get_clock(rt_clock) + VNC_REFRESH_INTERVAL);
return;
}
qemu_mod_timer(vs->timer, qemu_get_clock(rt_clock) + VNC_REFRESH_INTERVAL);
return;
}
vs->output.buffer[saved_offset] = (n_rectangles >> 8) & 0xFF;
vs->output.buffer[saved_offset + 1] = n_rectangles & 0xFF;
vnc_flush(vs);
vs->output.buffer[saved_offset] = (n_rectangles >> 8) & 0xFF;
vs->output.buffer[saved_offset + 1] = n_rectangles & 0xFF;
vnc_flush(vs);
int i;
vs->need_update = 1;
int i;
vs->need_update = 1;
if (!incremental) {
for (i = 0; i < h; i++) {
vnc_set_bits(vs->guest.dirty[y_position + i],
if (!incremental) {
for (i = 0; i < h; i++) {
vnc_set_bits(vs->guest.dirty[y_position + i],
VncDisplay *vd;
int need_update;
VncDisplay *vd;
int need_update;
uint32_t features;
int absolute;
int last_x;
uint32_t features;
int absolute;
int last_x;