summaryrefslogtreecommitdiff
path: root/server/red_worker.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-10-03 21:23:54 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2014-02-13 17:38:02 +0100
commit5f6acb99591e2601a47aa5f0b0e2f0935b3dbca9 (patch)
treef5abf97ba5956b713f67692048037125ac12d1bd /server/red_worker.c
parentaf320c872684bac921e50a0f956c0c7e0fba4575 (diff)
worker: move red_process_surface
Diffstat (limited to 'server/red_worker.c')
-rw-r--r--server/red_worker.c49
1 files changed, 4 insertions, 45 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 041f8a51..d622dfc8 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -211,49 +211,6 @@ end:
}
-static void red_process_surface(RedWorker *worker, RedSurfaceCmd *surface,
- uint32_t group_id, int loadvm)
-{
- DisplayChannel *display = worker->display_channel;
- int surface_id;
- RedSurface *red_surface;
- uint8_t *data;
-
- surface_id = surface->surface_id;
- spice_return_if_fail(surface_id < display->n_surfaces);
-
- red_surface = &display->surfaces[surface_id];
-
- switch (surface->type) {
- case QXL_SURFACE_CMD_CREATE: {
- uint32_t height = surface->u.surface_create.height;
- int32_t stride = surface->u.surface_create.stride;
- int reloaded_surface = loadvm || (surface->flags & QXL_SURF_FLAG_KEEP_DATA);
-
- data = surface->u.surface_create.data;
- if (stride < 0) {
- data -= (int32_t)(stride * (height - 1));
- }
- display_channel_create_surface(worker->display_channel, surface_id, surface->u.surface_create.width,
- height, stride, surface->u.surface_create.format, data,
- reloaded_surface,
- // reloaded surfaces will be sent on demand
- !reloaded_surface);
- display_channel_set_surface_release_info(display, surface_id, 1, surface->release_info, group_id);
- break;
- }
- case QXL_SURFACE_CMD_DESTROY:
- spice_warn_if(!red_surface->context.canvas);
- display_channel_set_surface_release_info(display, surface_id, 0, surface->release_info, group_id);
- display_channel_destroy_surface(display, surface_id);
- break;
- default:
- spice_warn_if_reached();
- };
- red_put_surface_cmd(surface);
- free(surface);
-}
-
static int red_process_cursor(RedWorker *worker, uint32_t max_pipe_size, int *ring_is_empty)
{
QXLCommandExt ext_cmd;
@@ -404,7 +361,8 @@ static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int *
free(surface);
break;
}
- red_process_surface(worker, surface, ext_cmd.group_id, FALSE);
+ display_channel_process_surface_cmd(worker->display_channel, surface,
+ ext_cmd.group_id, FALSE);
break;
}
default:
@@ -1467,7 +1425,8 @@ static int loadvm_command(RedWorker *worker, QXLCommandExt *ext)
free(surface_cmd);
return FALSE;
}
- red_process_surface(worker, surface_cmd, ext->group_id, TRUE);
+ display_channel_process_surface_cmd(worker->display_channel, surface_cmd,
+ ext->group_id, TRUE);
break;
default:
spice_warning("unhandled loadvm command type (%d)", ext->cmd.type);