[Spice-devel] [RFC v4 49/62] server/red_worker: handle_dev_destroy_primary_surface: clear all primary copies

Marc-André Lureau marcandre.lureau at gmail.com
Mon May 2 16:54:34 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 |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index ca59662..5fb8a5f 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -10357,7 +10357,8 @@ static inline void handle_dev_destroy_primary_surface(RedWorker *worker)
>  {
>     RedWorkerMessage message;
>     uint32_t surface_id;
> -    Surfaces *surfaces = &worker->surfaces;
> +    Surfaces *surfaces;
> +    RingItem *link;
>     RedChannel *cursor_red_channel = &worker->cursor_channel->common.base;
>
>     receive_data(worker->channel, &surface_id, sizeof(uint32_t));
> @@ -10380,11 +10381,13 @@ static inline void handle_dev_destroy_primary_surface(RedWorker *worker)
>     }
>
>     flush_all_qxl_commands(worker);
> -    destroy_surface_wait(worker, surfaces, 0);
> -    red_destroy_surface(worker, surfaces, 0);
> -    ASSERT(ring_is_empty(&surfaces->streams));
> +    SURFACES_FOREACH(link, surfaces, worker) {
> +        destroy_surface_wait(worker, surfaces, 0);
> +        red_destroy_surface(worker, surfaces, 0);
> +        ASSERT(ring_is_empty(&surfaces->streams));
> +    }
>
> -    ASSERT(!surfaces->surfaces[surface_id].context.canvas);
> +    ASSERT(!worker->surfaces.surfaces[surface_id].context.canvas);
>
>     worker->cursor_visible = TRUE;
>     worker->cursor_position.x = worker->cursor_position.y = 0;
> --
> 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