summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2015-11-20 09:25:43 +0000
committerFrediano Ziglio <fziglio@redhat.com>2015-11-24 17:30:45 +0000
commit790707b9ee82e1ff8fbbe6b3a2a97cf726e576f2 (patch)
tree668168e3175513d25150c52737e433b5a798b9ac /server
parentca41ff2be08f36d712f829d8eaf44e33ae75b07b (diff)
downloadspice-790707b9ee82e1ff8fbbe6b3a2a97cf726e576f2.zip
spice-790707b9ee82e1ff8fbbe6b3a2a97cf726e576f2.tar.gz
spice-790707b9ee82e1ff8fbbe6b3a2a97cf726e576f2.tar.xz
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@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
Diffstat (limited to 'server')
-rw-r--r--server/red_worker.c10
1 files changed, 4 insertions, 6 deletions
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);
}