[Spice-devel] [spice-server v2 1/3] dcc: Fix QUIC fallback in get_compression_for_bitmap()

Christophe Fergeau cfergeau at redhat.com
Fri Jul 20 09:46:38 UTC 2018


Slight screwup on my side, this is a single patch, not a series of 3
patches as the email subject says.

Christophe

On Fri, Jul 20, 2018 at 11:44:51AM +0200, Christophe Fergeau wrote:
> There was a small regression introduced in get_compression_for_bitmap()
> by f401eb07f dcc: Rewrite dcc_image_compress.
> If SPICE_IMAGE_COMPRESSION_AUTO_GLZ is specified, and the bitmap has a
> stride which is bigger than its width (ie it has padding), then
> get_compression_for_bitmap() will return SPICE_IMAGE_COMPRESSION_OFF
> while in that case, we used to use QUIC for compression.
> 
> This happens because that function in the AUTO_GLZ case first checks if
> QUIC should be used, if not, it decides to use GLZ, but then decides it
> can't because of the stride, so falls back to OFF, while it used to
> fall back to QUIC.
> 
> This commit only slightly reworks a preexisting if (!can_lz_compress())
> check so that it's unconditional rather than depending on the previous
> checks having been unsuccessful.
> 
> This issue could be observed by using a spice-html5 without support for
> uncompressed bitmaps with end-of-line padding by simply starting a f28
> VM and connecting to it/moving the mouse cursor in it.
> ---
>  server/dcc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/server/dcc.c b/server/dcc.c
> index 44d8fdd75..0468e7213 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -796,8 +796,10 @@ static SpiceImageCompression get_compression_for_bitmap(SpiceBitmap *bitmap,
>                      bitmap_get_graduality_level(bitmap) == BITMAP_GRADUAL_HIGH) {
>                      return SPICE_IMAGE_COMPRESSION_QUIC;
>                  }
> -            } else if (!can_lz_compress(bitmap) ||
> -                       drawable->copy_bitmap_graduality == BITMAP_GRADUAL_HIGH) {
> +            } else if (drawable->copy_bitmap_graduality == BITMAP_GRADUAL_HIGH) {
> +                return SPICE_IMAGE_COMPRESSION_QUIC;
> +            }
> +            if (!can_lz_compress(bitmap)) {
>                  return SPICE_IMAGE_COMPRESSION_QUIC;
>              }
>          }
> -- 
> 2.17.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180720/24c6603d/attachment-0001.sig>


More information about the Spice-devel mailing list