vnc: fix vmware VGA incompatiblities

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTJ/ReAAoJEEy22O7T6HE4qowP/1tx0xpDbB50IxuvamyZCgeg
 w9btoYKTbXFCvPxwvo6MHLkWquo7MjVWCZRjcD1cLeO7c+9Rr5c+PNhaX7hnoJOe
 WFmb1xnug6fUT1AX4kSaAAP/e5WWL9u+L0ByRaNNwh+0mxRLELAzBePS2VmhVUn/
 iUKCpY34+n1KApYIYELSv0QKfZ575wjSupZnW3gqnhtYo+8it+cJRcZEpI1NyZwt
 2CY7mRAEe6YsrZeUNc95GTSDpEcmlaP7uFKigtPlWN8m0qxdFP9zlwLRJO2Ny3/D
 Tm/gNBtdDzXgJ6QqGzXPqyhD5JJPJVQVIXIGOOhMrNmL/nFS8NW0a778CRtKniiB
 T8PW5uZNQvQvQly0oM2WkzMrHVh3AH+Z+Yc+5Q2RHgygJGikR8yhLnAUgVB4UA6i
 +YJ7ZKMYox4v9pE8VahN9mJ98CR/IYdIsbgLuR1F+zYY6iczUYkoXSpnhOtv+DA1
 N+F1v28snF2k8haUTo7+J7ep6oJ1RJ8BYYdpFggpF6Xoq3zD7XHQbPM0gE64iDjR
 7n06VRpMGJjSSq/LgXTpPNH/hL8oYvMKCFFhg+qRm+s7SW5VqNdyi0dZdKSS20BN
 I+l+2o4+VTsKbvw7caCjDc6CXNflBtVSqCcI6XQFBWPM9BUwvXL4WV9nyl3ODQ2I
 0D94LhmT3j8wqpl1z5p5
 =j3EC
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-2' into staging

vnc: fix vmware VGA incompatiblities

# gpg: Signature made Tue 18 Mar 2014 07:23:10 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-vnc-2:
  ui/vnc: fix vmware VGA incompatiblities

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2014-03-18 16:39:29 +00:00
commit 059b3527f0
2 changed files with 9 additions and 4 deletions

View File

@ -25,6 +25,7 @@
#include "hw/loader.h"
#include "trace.h"
#include "ui/console.h"
#include "ui/vnc.h"
#include "hw/pci/pci.h"
#undef VERBOSE
@ -218,7 +219,7 @@ enum {
/* These values can probably be changed arbitrarily. */
#define SVGA_SCRATCH_SIZE 0x8000
#define SVGA_MAX_WIDTH 2360
#define SVGA_MAX_WIDTH ROUND_UP(2360, VNC_DIRTY_PIXELS_PER_BIT)
#define SVGA_MAX_HEIGHT 1770
#ifdef VERBOSE

View File

@ -888,7 +888,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
VncDisplay *vd = vs->vd;
VncJob *job;
int y;
int height;
int height, width;
int n = 0;
if (vs->output.offset && !vs->audio_cap && !vs->force_update)
@ -907,6 +907,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
job = vnc_job_new(vs);
height = MIN(pixman_image_get_height(vd->server), vs->client_height);
width = MIN(pixman_image_get_width(vd->server), vs->client_width);
y = 0;
for (;;) {
@ -925,8 +926,11 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
VNC_DIRTY_BPL(vs), x);
bitmap_clear(vs->dirty[y], x, x2 - x);
h = find_and_clear_dirty_height(vs, y, x, x2, height);
n += vnc_job_add_rect(job, x * VNC_DIRTY_PIXELS_PER_BIT, y,
(x2 - x) * VNC_DIRTY_PIXELS_PER_BIT, h);
x2 = MIN(x2, width / VNC_DIRTY_PIXELS_PER_BIT);
if (x2 > x) {
n += vnc_job_add_rect(job, x * VNC_DIRTY_PIXELS_PER_BIT, y,
(x2 - x) * VNC_DIRTY_PIXELS_PER_BIT, h);
}
}
vnc_job_push(job);