[Spice-devel] Patch to support LZ4 compression algorithm‏‏

Fabio Fantoni fantonifabio at tiscali.it
Thu Jan 8 08:15:48 PST 2015


Il 07/01/2015 10:13, LgDoor ha scritto:
> I think the cause of this problem is the unnecessary step of flipping the bitmap buffer lines when encoding, since the surface in the client will be created with the top-down param. 
> this patch just works.

I tried your patch in attachment removing 2 parts (see below) and I can
confirm that it partially solves critical lz4 bug.
I'll post details with backtrace tomorrow.

I had this error on compile:
red_worker.c:264:1: error: 'inline' is not at beginning of declaration
[-Werror=old-style-declaration]
red_worker.c: In function 'print_compress_stats':
red_worker.c:1172:5: error: 'CommonChannel' has no member named 'id'
Solved removing this part of patch:
> -//#define COMPRESS_STAT
> +#define COMPRESS_STAT

I think should be posted to mailing list for better review and add in
upstream.
Before post it I think that 2 changes should be remove, first the
mentioned above and this:
> -            if (image_compression == SPICE_IMAGE_COMPRESS_LZ4 &&
> +            if (true &&

Thanks for any reply and sorry for my bad english.


> ----------------------------------------
>> From: javier.celaya at flexvm.es
>> To: spice-devel at lists.freedesktop.org
>> Date: Wed, 7 Jan 2015 09:22:52 +0100
>> Subject: Re: [Spice-devel] Patch to support LZ4 compression algorithm‏‏
>>
>> Hello
>>
>> To enable LZ4 from the qemu command line, you have to add this to ui/spice-
>> core.c:
>>
>> static const char *compression_names[] = {
>> [ SPICE_IMAGE_COMPRESS_OFF ] = "off",
>> [ SPICE_IMAGE_COMPRESS_AUTO_GLZ ] = "auto_glz",
>> [ SPICE_IMAGE_COMPRESS_AUTO_LZ ] = "auto_lz",
>> [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic",
>> [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz",
>> [ SPICE_IMAGE_COMPRESS_LZ ] = "lz",
>> + [ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4",
>> };
>>
>> Build qemu, and then you can use --spice image-compression=lz4.
>>
>> About the problem with SPICE_BITMAP_FLAGS_TOP_DOWN, I'll have a look at it
>> ASAP.
>>
>> Thanks for your feedback.
>>
>> El Miércoles, 7 de enero de 2015 15:48:43 LgDoor escribió:
>>> i'm not sure but it seems lz4 won't be enabled unless adding a new value of
>>> the image_compress parameter in QEMU.
>>> so i just replace lz with lz4, at red_compress_image() in red_worker.c,
>> 6680:
>>>> if (image_compression == SPICE_IMAGE_COMPRESS_LZ4 &&
>>>> red_channel_client_test_remote_cap(&dcc->common.base,
>>>> SPICE_DISPLAY_CAP_LZ4_COMPRESSION)) {
>>> changes to
>>>
>>>> if (true && .......
>>> and launch qemu with --spice image-compression=auto_lz.
>>>
>>> ----------------------------------------
>>>
>>>> Date: Wed, 7 Jan 2015 08:15:07 +0100
>>>> From: fantonifabio at tiscali.it
>>>> To: lgdoor at outlook.com; spice-devel at lists.freedesktop.org
>>>> Subject: Re: [Spice-devel] Patch to support LZ4 compression algorithm‏‏
>>>>
>>>> Il 07/01/2015 08:01, LgDoor ha scritto:
>>>>> has anybody tried this feature and encountered the displaying problems?
>>>>>
>>>>> I just made a small change to enable lz4, but the image turns out to be
>>>>> broken (see the screenshots). And I observed that it goes wrong only for
>>>>> the SpiceBitmap w/o SPICE_BITMAP_FLAGS_TOP_DOWN flag in the
>>>>> red_compress_image() function from red_worker.c .>
>>>> What change you did?
>>>> I tried it only using both server and client compiled with it and FWIK
>>>> should be used automatically if no image compression specified.
>>>>
>>>>> 2014-11-14 0:11 GMT+08:00 Javier Celaya <javier.celaya at flexvm.es>:
>>>>>> Hello
>>>>>>
>>>>>> There they go.
>>>>>>
>>>>>> However, don't forget that, since spice-protocol is a submodule of
>>>>>> spice-
>>>>>> common, once you push the commit for spice-protocol, the commit for
>>>>>> spice-
>>>>>> common should point to it. The same with spice and spice-gtk in relation
>>>>>> to
>>>>>> spice-common.
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> El Jueves, 13 de noviembre de 2014 16:04:00 Christophe Fergeau escribió:
>>>>>>> Hey,
>>>>>>>
>>>>>>> On Fri, Nov 07, 2014 at 10:17:11AM +0100, Javier Celaya wrote:
>>>>>>>> Hello
>>>>>>>>
>>>>>>>> I resend the patch for the spice repository. I just realized I forgot
>>>>>>>> to
>>>>>>>> remove a debug message from red_worker.c, sorry.
>>>>>>> Thanks for the updated patches, they look good to me. There are 2 blank
>>>>>>> lines at the end of lz4_encoder.[ch] which should be removed.
>>>>>>> Can you resend these patches generated with git-format-patch so that
>>>>>>> they contain a commit log, and an author name/address? Then they can be
>>>>>>> pushed upstream.
>>>>>>>
>>>>>>> Christophe
>>>>>> _______________________________________________
>>>>>> Spice-devel mailing list
>>>>>> Spice-devel at lists.freedesktop.org
>>>>>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>>>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4297 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150108/4642dcd4/attachment.bin>


More information about the Spice-devel mailing list