[Spice-devel] [PATCH v2] server: add async io support

Yonit Halperin yhalperi at redhat.com
Wed Jul 6 23:38:01 PDT 2011


On 07/06/2011 08:37 PM, Alon Levy wrote:
> The new _ASYNC io's in qxl_dev listed at the end get six new api
> functions, and an additional callback function "async_complete". When
> the async version of a specific io is used, completion is notified by
> calling async_complete, and no READY message is written or expected by
> the dispatcher.
>
> update_area has been changed to push QXLRects to the worker thread, where
> the conversion to SpiceRect takes place.
>
> Added api:
>
> QXLWorker:
>      update_area_async
>      add_memslot_async
>      destroy_surfaces_async
>      destroy_primary_surface_async
>      create_primary_surface_async
>      destroy_surface_wait_async
>      oom_async
>
>
>
> -static void qxl_worker_oom(QXLWorker *qxl_worker)
> +static void qxl_worker_oom_helper(QXLWorker *qxl_worker, int async)
>   {
>       RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
> +    RedWorkerMessage message;
> +
>       if (!test_bit(RED_WORKER_PENDING_OOM, dispatcher->pending)) {
> -        RedWorkerMessage message = RED_WORKER_MESSAGE_OOM;
> +        if (async) {
> +            message = RED_WORKER_MESSAGE_OOM_ASYNC;
> +        } else {
> +            message = RED_WORKER_MESSAGE_OOM;
> +        }
>           set_bit(RED_WORKER_PENDING_OOM,&dispatcher->pending);
>           write_message(dispatcher->channel,&message);
>       }
>   }
>

OOM has always been async - do we need two different RED_WORKER_MESSAGEs?

> +static void qxl_worker_oom(QXLWorker *qxl_worker)
> +{
> +    qxl_worker_oom_helper(qxl_worker, 0);
> +}
> +
> +static void qxl_worker_oom_async(QXLWorker *qxl_worker)
> +{
> +    qxl_worker_oom_helper(qxl_worker, 1);
> +}
> +



More information about the Spice-devel mailing list