[Spice-commits] server/red_worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Tue Nov 24 09:32:18 PST 2015


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

New commits:
commit 790707b9ee82e1ff8fbbe6b3a2a97cf726e576f2
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Nov 20 09:25:43 2015 +0000

    worker: simplify handle_dev_oom
    
    Do not check if worker->display_channel is NULL as we are already using
    to get some field so must be not NULL.
    Reuse display_red_channel variable.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/server/red_worker.c b/server/red_worker.c
index 1d95f8f..6dac29d 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -4729,7 +4729,7 @@ static void handle_dev_oom(void *opaque, void *payload)
     RedWorker *worker = opaque;
     DisplayChannel *display = worker->display_channel;
 
-    RedChannel *display_red_channel = &worker->display_channel->common.base;
+    RedChannel *display_red_channel = &display->common.base;
     int ring_is_empty;
 
     spice_return_if_fail(worker->running);
@@ -4739,10 +4739,9 @@ static void handle_dev_oom(void *opaque, void *payload)
                 display->red_drawable_count,
                 display->glz_drawable_count,
                 display->current_size,
-                worker->display_channel ?
-                red_channel_sum_pipes_size(display_red_channel) : 0);
+                red_channel_sum_pipes_size(display_red_channel));
     while (red_process_commands(worker, MAX_PIPE_SIZE, &ring_is_empty)) {
-        red_channel_push(&worker->display_channel->common.base);
+        red_channel_push(display_red_channel);
     }
     if (worker->qxl->st->qif->flush_resources(worker->qxl) == 0) {
         display_channel_free_some(worker->display_channel);
@@ -4753,8 +4752,7 @@ static void handle_dev_oom(void *opaque, void *payload)
                 display->red_drawable_count,
                 display->glz_drawable_count,
                 display->current_size,
-                worker->display_channel ?
-                red_channel_sum_pipes_size(display_red_channel) : 0);
+                red_channel_sum_pipes_size(display_red_channel));
     red_dispatcher_clear_pending(worker->red_dispatcher, RED_DISPATCHER_PENDING_OOM);
 }
 


More information about the Spice-commits mailing list