[Spice-commits] server/red_worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Nov 12 04:33:48 PST 2015


 server/red_worker.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit f4810b0065c17506039e981349557cf95a8b08f7
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Thu Nov 12 13:24:58 2015 +0100

    worker: Remove usage of streaming_video global in DisplayChannel
    
    Avoid creating streams for every image due to not properly initialized
    DisplayChannel->stream_video field.
    
    Regression since: 4987df8e67f48cde13d39f4e81909f672ae33e29
    
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/red_worker.c b/server/red_worker.c
index 286bde4..633e1d0 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1975,13 +1975,12 @@ static void before_reattach_stream(DisplayChannel *display,
     }
 }
 
-static void update_copy_graduality(Drawable *drawable)
+static void update_copy_graduality(DisplayChannel *display, Drawable *drawable)
 {
     SpiceBitmap *bitmap;
     spice_return_if_fail(drawable->red_drawable->type == QXL_DRAW_COPY);
 
-    /* TODO: global property -> per dc/dcc */
-    if (streaming_video != SPICE_STREAM_VIDEO_FILTER) {
+    if (display->stream_video != SPICE_STREAM_VIDEO_FILTER) {
         drawable->copy_bitmap_graduality = BITMAP_GRADUAL_INVALID;
         return;
     }
@@ -2014,7 +2013,7 @@ static int display_channel_stream_add_frame(DisplayChannel *display,
                                             int gradual_frames_count,
                                             int last_gradual_frame)
 {
-    update_copy_graduality(frame_drawable);
+    update_copy_graduality(display, frame_drawable);
     frame_drawable->frames_count = frames_count + 1;
     frame_drawable->gradual_frames_count  = gradual_frames_count;
 
@@ -8537,7 +8536,7 @@ static void init_streams(DisplayChannel *display)
     }
 }
 
-static void display_channel_create(RedWorker *worker, int migrate)
+static void display_channel_create(RedWorker *worker, int migrate, int stream_video)
 {
     DisplayChannel *display_channel;
     ChannelCbs cbs = {
@@ -8585,6 +8584,7 @@ static void display_channel_create(RedWorker *worker, int migrate)
     display_channel->num_renderers = num_renderers;
     memcpy(display_channel->renderers, renderers, sizeof(display_channel->renderers));
     display_channel->renderer = RED_RENDERER_INVALID;
+    display_channel->stream_video = stream_video;
     init_streams(display_channel);
     image_cache_init(&display_channel->image_cache);
     ring_init(&display_channel->current_list);
@@ -9752,7 +9752,7 @@ RedWorker* red_worker_new(QXLInstance *qxl, RedDispatcher *red_dispatcher)
 
     worker->cursor_channel = cursor_channel_new(worker);
     // TODO: handle seemless migration. Temp, setting migrate to FALSE
-    display_channel_create(worker, FALSE);
+    display_channel_create(worker, FALSE, streaming_video);
 
     return worker;
 }


More information about the Spice-commits mailing list