From 096f49afbf4e83ccee80f58479b3ff05bd355660 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 6 Jul 2011 02:12:19 +0200 Subject: server: add async io support 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. A cookie has been added to each async call to QXLWorker, and is passed back via async_complete. Added api: QXLWorker: update_area_async add_memslot_async destroy_surfaces_async destroy_primary_surface_async create_primary_surface_async destroy_surface_wait_async QXLInterface: async_complete --- server/spice.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/spice.h') diff --git a/server/spice.h b/server/spice.h index 0b82bb78..c7f0a6ef 100644 --- a/server/spice.h +++ b/server/spice.h @@ -20,6 +20,7 @@ #include #include +#include #define SPICE_SERVER_VERSION 0x000900 /* release 0.9.0 */ @@ -143,6 +144,15 @@ void spice_qxl_reset_image_cache(QXLInstance *instance); void spice_qxl_reset_cursor(QXLInstance *instance); void spice_qxl_destroy_surface_wait(QXLInstance *instance, uint32_t surface_id); void spice_qxl_loadvm_commands(QXLInstance *instance, struct QXLCommandExt *ext, uint32_t count); +/* async versions of commands. when complete spice calls async_complete */ +void spice_qxl_update_area_async(QXLInstance *instance, uint32_t surface_id, QXLRect *qxl_area, + uint32_t clear_dirty_region, uint64_t cookie); +void spice_qxl_add_memslot_async(QXLInstance *instance, QXLDevMemSlot *slot, uint64_t cookie); +void spice_qxl_destroy_surfaces_async(QXLInstance *instance, uint64_t cookie); +void spice_qxl_destroy_primary_surface_async(QXLInstance *instance, uint32_t surface_id, uint64_t cookie); +void spice_qxl_create_primary_surface_async(QXLInstance *instance, uint32_t surface_id, + QXLDevSurfaceCreate *surface, uint64_t cookie); +void spice_qxl_destroy_surface_async(QXLInstance *instance, uint32_t surface_id, uint64_t cookie); typedef struct QXLDrawArea { uint8_t *buf; @@ -212,6 +222,7 @@ struct QXLInterface { int (*req_cursor_notification)(QXLInstance *qin); void (*notify_update)(QXLInstance *qin, uint32_t update_id); int (*flush_resources)(QXLInstance *qin); + void (*async_complete)(QXLInstance *qin, uint64_t cookie); }; struct QXLInstance { -- cgit