vnc: fix zlib compression artifacts.
ui: add "none" to -display help. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJeKavFAAoJEEy22O7T6HE4jR8P/AnX/EqfmksfqATZSOvpjVQj qspUIYvgg3itI3LeNP1oMuPoI7157fEmzAPo2LNEBHyJfqTg9HjDUMevATs/k3fZ iiD1BCSIPiAJySqZ6ULn/mpir8MuiLdcRrVsN0oj8f9hDEJ803g7tjRSZKGxU+HL H7ICmULKH4YeDE+q9NluLKxom76RuZsWUKlvLoiiaO6oG40xT8hAbrp59EQ7Rhze lVJayhm8uUVt4yIbhO6Y5sY5NxwER2DJK7v7WczuTkidWXjW/RZfes9Hfy+UQ7Fv p5KdUHxXfOWbe6R0P4SG9jh29PdnJh/3acDIepr2h+bG8whgHD3sGIoTxEweB/wz 0wNIGp/5JF7JJwE5luMnbfxEtnXBZ4c3X2cr9PBFzm6Yid9qhH8aldCLKdh3dG+7 QXYRXprtjDkp2JlduPW5sbyHjzX6M2PQ48kKr2sj/IFKB8I1dz0v1hX9NkZQx8UF fXqx48GFAXv+Hobb8OpE9ru+i8/PNHFFEShcz+clHE67OIm6sXdZHBHSpH7+dDpi iXamaVkBb9PgbvEzyFM3bS5gJq2k4EPUdFFmbPgYfOfwMnMxZvYgXpwjzfFNpoK/ rCMar/JrmdiBwY9l4r2CIhifweMin1i7kqxu3g7DFypRE4/b+nQmgRu/szzHm5Q5 Bu4S90f2GoqjcucgNPBQ =+VAq -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/ui-20200123-pull-request' into staging vnc: fix zlib compression artifacts. ui: add "none" to -display help. # gpg: Signature made Thu 23 Jan 2020 14:20:53 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/ui-20200123-pull-request: ui/console: Display the 'none' backend in '-display help' vnc: prioritize ZRLE compression over ZLIB Revert "vnc: allow fall back to RAW encoding" Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
c0248b36d8
|
@ -2338,6 +2338,7 @@ void qemu_display_help(void)
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
printf("Available display backend types:\n");
|
printf("Available display backend types:\n");
|
||||||
|
printf("none\n");
|
||||||
for (idx = DISPLAY_TYPE_NONE; idx < DISPLAY_TYPE__MAX; idx++) {
|
for (idx = DISPLAY_TYPE_NONE; idx < DISPLAY_TYPE__MAX; idx++) {
|
||||||
if (!dpys[idx]) {
|
if (!dpys[idx]) {
|
||||||
ui_module_load_one(DisplayType_str(idx));
|
ui_module_load_one(DisplayType_str(idx));
|
||||||
|
|
|
@ -98,8 +98,8 @@ static int zrle_compress_data(VncState *vs, int level)
|
||||||
/* set pointers */
|
/* set pointers */
|
||||||
zstream->next_in = vs->zrle->zrle.buffer;
|
zstream->next_in = vs->zrle->zrle.buffer;
|
||||||
zstream->avail_in = vs->zrle->zrle.offset;
|
zstream->avail_in = vs->zrle->zrle.offset;
|
||||||
zstream->next_out = vs->zrle->zlib.buffer + vs->zrle->zlib.offset;
|
zstream->next_out = vs->zrle->zlib.buffer;
|
||||||
zstream->avail_out = vs->zrle->zlib.capacity - vs->zrle->zlib.offset;
|
zstream->avail_out = vs->zrle->zlib.capacity;
|
||||||
zstream->data_type = Z_BINARY;
|
zstream->data_type = Z_BINARY;
|
||||||
|
|
||||||
/* start encoding */
|
/* start encoding */
|
||||||
|
|
25
ui/vnc.c
25
ui/vnc.c
|
@ -898,8 +898,6 @@ int vnc_raw_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
|
||||||
int vnc_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
|
int vnc_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = 0;
|
||||||
bool encode_raw = false;
|
|
||||||
size_t saved_offs = vs->output.offset;
|
|
||||||
|
|
||||||
switch(vs->vnc_encoding) {
|
switch(vs->vnc_encoding) {
|
||||||
case VNC_ENCODING_ZLIB:
|
case VNC_ENCODING_ZLIB:
|
||||||
|
@ -922,24 +920,10 @@ int vnc_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
|
||||||
n = vnc_zywrle_send_framebuffer_update(vs, x, y, w, h);
|
n = vnc_zywrle_send_framebuffer_update(vs, x, y, w, h);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
encode_raw = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the client has the same pixel format as our internal buffer and
|
|
||||||
* a RAW encoding would need less space fall back to RAW encoding to
|
|
||||||
* save bandwidth and processing power in the client. */
|
|
||||||
if (!encode_raw && vs->write_pixels == vnc_write_pixels_copy &&
|
|
||||||
12 + h * w * VNC_SERVER_FB_BYTES <= (vs->output.offset - saved_offs)) {
|
|
||||||
vs->output.offset = saved_offs;
|
|
||||||
encode_raw = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (encode_raw) {
|
|
||||||
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_RAW);
|
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_RAW);
|
||||||
n = vnc_raw_send_framebuffer_update(vs, x, y, w, h);
|
n = vnc_raw_send_framebuffer_update(vs, x, y, w, h);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2087,8 +2071,15 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case VNC_ENCODING_ZLIB:
|
case VNC_ENCODING_ZLIB:
|
||||||
|
/*
|
||||||
|
* VNC_ENCODING_ZRLE compresses better than VNC_ENCODING_ZLIB.
|
||||||
|
* So prioritize ZRLE, even if the client hints that it prefers
|
||||||
|
* ZLIB.
|
||||||
|
*/
|
||||||
|
if ((vs->features & VNC_FEATURE_ZRLE_MASK) == 0) {
|
||||||
vs->features |= VNC_FEATURE_ZLIB_MASK;
|
vs->features |= VNC_FEATURE_ZLIB_MASK;
|
||||||
vs->vnc_encoding = enc;
|
vs->vnc_encoding = enc;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VNC_ENCODING_ZRLE:
|
case VNC_ENCODING_ZRLE:
|
||||||
vs->features |= VNC_FEATURE_ZRLE_MASK;
|
vs->features |= VNC_FEATURE_ZRLE_MASK;
|
||||||
|
|
Loading…
Reference in a new issue