[Spice-devel] [RFC v4 48/62] server/red_worker: handle_dev_destroy_surfaces: clear all surfaces
Marc-André Lureau
marcandre.lureau at gmail.com
Mon May 2 16:54:40 PDT 2011
Could be merged with 41/62 start using SURFACES_FOREACH
On Tue, Apr 26, 2011 at 12:55 PM, Alon Levy <alevy at redhat.com> wrote:
> ---
> server/red_worker.c | 20 +++++++++++++-------
> 1 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 9795dab..ca59662 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -10256,16 +10256,10 @@ static inline void handle_dev_destroy_surface_wait(RedWorker *worker)
> }
>
> /* called upon device reset */
> -
> -/* TODO: split me*/
> -static inline void handle_dev_destroy_surfaces(RedWorker *worker)
> +static inline void __handle_dev_destroy_surfaces(RedWorker *worker, Surfaces *surfaces)
> {
Another name suggestion: red_worker_surfaces_remove_all() or perhaps
red_worker_destroy_all_surfaces()
> - Surfaces *surfaces = &worker->surfaces;
> int i;
> - RedWorkerMessage message;
>
> - red_printf("");
> - flush_all_qxl_commands(worker);
> //to handle better
> for (i = 0; i < NUM_SURFACES; ++i) {
> if (surfaces->surfaces[i].context.canvas) {
> @@ -10277,7 +10271,19 @@ static inline void handle_dev_destroy_surfaces(RedWorker *worker)
> }
> }
> ASSERT(ring_is_empty(&surfaces->streams));
> +}
>
> +static inline void handle_dev_destroy_surfaces(RedWorker *worker)
> +{
> + RedWorkerMessage message;
> + RingItem *link;
> + Surfaces *surfaces;
> +
> + red_printf("");
> + flush_all_qxl_commands(worker);
> + SURFACES_FOREACH(link, surfaces, worker) {
> + __handle_dev_destroy_surfaces(worker, surfaces);
> + }
> if (cursor_connected(worker)) {
> red_wait_outgoing_items(&worker->cursor_channel->common.base);
> red_channel_pipes_add_type(&worker->cursor_channel->common.base,
> --
> 1.7.4.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
--
Marc-André Lureau
More information about the Spice-devel
mailing list