summaryrefslogtreecommitdiffstats
path: root/server/display-channel.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-14 03:21:28 +0200
committerFrediano Ziglio <fziglio@redhat.com>2015-11-10 17:38:48 +0000
commit4a1668a755fb2af6e27a0ab7acb69c6e84842200 (patch)
tree0498a9ed135c2f13a88cf09abc02516ffc6e33e0 /server/display-channel.c
parent4987df8e67f48cde13d39f4e81909f672ae33e29 (diff)
downloadspice-4a1668a755fb2af6e27a0ab7acb69c6e84842200.tar.gz
spice-4a1668a755fb2af6e27a0ab7acb69c6e84842200.tar.xz
spice-4a1668a755fb2af6e27a0ab7acb69c6e84842200.zip
worker: move red_destroy_surface_item()
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'server/display-channel.c')
-rw-r--r--server/display-channel.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/server/display-channel.c b/server/display-channel.c
index 8775496b..b5d8830a 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -226,6 +226,42 @@ void dcc_push_monitors_config(DisplayChannelClient *dcc)
red_channel_client_push(&dcc->common.base);
}
+static SurfaceDestroyItem *surface_destroy_item_new(RedChannel *channel,
+ uint32_t surface_id)
+{
+ SurfaceDestroyItem *destroy;
+
+ destroy = spice_malloc(sizeof(SurfaceDestroyItem));
+ destroy->surface_destroy.surface_id = surface_id;
+ red_channel_pipe_item_init(channel, &destroy->pipe_item,
+ PIPE_ITEM_TYPE_DESTROY_SURFACE);
+
+ return destroy;
+}
+
+void dcc_push_destroy_surface(DisplayChannelClient *dcc, uint32_t surface_id)
+{
+ DisplayChannel *display;
+ RedChannel *channel;
+ SurfaceDestroyItem *destroy;
+
+ if (!dcc) {
+ return;
+ }
+
+ display = DCC_TO_DC(dcc);
+ channel = RED_CHANNEL(display);
+
+ if (COMMON_CHANNEL(display)->during_target_migrate ||
+ !dcc->surface_client_created[surface_id]) {
+ return;
+ }
+
+ dcc->surface_client_created[surface_id] = FALSE;
+ destroy = surface_destroy_item_new(channel, surface_id);
+ red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), &destroy->pipe_item);
+}
+
int display_channel_get_streams_timeout(DisplayChannel *display)
{
int timeout = INT_MAX;