[Spice-devel] [PATCH 05/11] dcc: remove group_id from compression functions

Frediano Ziglio fziglio at redhat.com
Tue Feb 9 10:27:54 UTC 2016


The parameter was not used.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/dcc.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index 8fe7fc3..99aadf0 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -725,7 +725,7 @@ glz:
 
 static int dcc_compress_image_lz(DisplayChannelClient *dcc,
                                  SpiceImage *dest, SpiceBitmap *src,
-                                 compress_send_data_t* o_comp_data, uint32_t group_id)
+                                 compress_send_data_t* o_comp_data)
 {
     LzData *lz_data = &dcc->lz_data;
     LzContext *lz = dcc->lz;
@@ -786,8 +786,7 @@ static int dcc_compress_image_lz(DisplayChannelClient *dcc,
 }
 
 static int dcc_compress_image_jpeg(DisplayChannelClient *dcc, SpiceImage *dest,
-                                   SpiceBitmap *src, compress_send_data_t* o_comp_data,
-                                   uint32_t group_id)
+                                   SpiceBitmap *src, compress_send_data_t* o_comp_data)
 {
     JpegData *jpeg_data = &dcc->jpeg_data;
     LzData *lz_data = &dcc->lz_data;
@@ -911,8 +910,7 @@ static int dcc_compress_image_jpeg(DisplayChannelClient *dcc, SpiceImage *dest,
 
 #ifdef USE_LZ4
 static int dcc_compress_image_lz4(DisplayChannelClient *dcc, SpiceImage *dest,
-                                  SpiceBitmap *src, compress_send_data_t* o_comp_data,
-                                  uint32_t group_id)
+                                  SpiceBitmap *src, compress_send_data_t* o_comp_data)
 {
     Lz4Data *lz4_data = &dcc->lz4_data;
     Lz4EncoderContext *lz4 = dcc->lz4;
@@ -958,8 +956,7 @@ static int dcc_compress_image_lz4(DisplayChannelClient *dcc, SpiceImage *dest,
 #endif
 
 static int dcc_compress_image_quic(DisplayChannelClient *dcc, SpiceImage *dest,
-                                   SpiceBitmap *src, compress_send_data_t* o_comp_data,
-                                   uint32_t group_id)
+                                   SpiceBitmap *src, compress_send_data_t* o_comp_data)
 {
     QuicData *quic_data = &dcc->quic_data;
     QuicContext *quic = dcc->quic;
@@ -1037,7 +1034,6 @@ int dcc_compress_image(DisplayChannelClient *dcc,
     DisplayChannel *display_channel = DCC_TO_DC(dcc);
     SpiceImageCompression image_compression = dcc->image_compression;
     int quic_compress = FALSE;
-    uint32_t group_id;
 
     if ((image_compression == SPICE_IMAGE_COMPRESSION_OFF) ||
         ((src->y * src->stride) < MIN_SIZE_TO_COMPRESS)) { // TODO: change the size cond
@@ -1082,12 +1078,6 @@ int dcc_compress_image(DisplayChannelClient *dcc,
         }
     }
 
-    if (drawable != NULL) {
-        group_id = drawable->group_id;
-    } else {
-        group_id = red_worker_get_memslot(display_channel->common.worker)->internal_groupslot_id;
-    }
-
     if (quic_compress) {
 #ifdef COMPRESS_DEBUG
         spice_info("QUIC compress");
@@ -1098,10 +1088,10 @@ int dcc_compress_image(DisplayChannelClient *dcc,
             (image_compression == SPICE_IMAGE_COMPRESSION_AUTO_GLZ))) {
             // if we use lz for alpha, the stride can't be extra
             if (src->format != SPICE_BITMAP_FMT_RGBA || !bitmap_has_extra_stride(src)) {
-                return dcc_compress_image_jpeg(dcc, dest, src, o_comp_data, group_id);
+                return dcc_compress_image_jpeg(dcc, dest, src, o_comp_data);
             }
         }
-        return dcc_compress_image_quic(dcc, dest, src, o_comp_data, group_id);
+        return dcc_compress_image_quic(dcc, dest, src, o_comp_data);
     } else {
         int glz;
         int ret;
@@ -1137,10 +1127,10 @@ int dcc_compress_image(DisplayChannelClient *dcc,
                 bitmap_fmt_is_rgb(src->format) &&
                 red_channel_client_test_remote_cap(&dcc->common.base,
                         SPICE_DISPLAY_CAP_LZ4_COMPRESSION)) {
-                ret = dcc_compress_image_lz4(dcc, dest, src, o_comp_data, group_id);
+                ret = dcc_compress_image_lz4(dcc, dest, src, o_comp_data);
             } else
 #endif
-                ret = dcc_compress_image_lz(dcc, dest, src, o_comp_data, group_id);
+                ret = dcc_compress_image_lz(dcc, dest, src, o_comp_data);
 #ifdef COMPRESS_DEBUG
             spice_info("LZ LOCAL compress");
 #endif
-- 
2.5.0



More information about the Spice-devel mailing list