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

Alon Levy alevy at redhat.com
Wed Jul 6 10:04:35 PDT 2011


On Wed, Jul 06, 2011 at 02:42:03PM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> >diff --git a/server/spice.h b/server/spice.h
> >index f64ff41..f0d5685 100644
> >--- a/server/spice.h
> >+++ b/server/spice.h
> >@@ -122,6 +122,17 @@ struct QXLWorker {
> >      void (*reset_cursor)(QXLWorker *worker);
> >      void (*destroy_surface_wait)(QXLWorker *worker, uint32_t surface_id);
> >      void (*loadvm_commands)(QXLWorker *worker, struct QXLCommandExt *ext, uint32_t count);
> >+    /* async versions of commands. when complete spice calls async_complete */
> >+    void (*update_area_async)(QXLWorker *qxl_worker, uint32_t surface_id,
> >+                       struct QXLRect *area, struct QXLRect *dirty_rects,
> >+                       uint32_t num_dirty_rects, uint32_t clear_dirty_region);
> >+    void (*add_memslot_async)(QXLWorker *worker, QXLDevMemSlot *slot);
> >+    void (*destroy_surfaces_async)(QXLWorker *worker);
> >+    void (*destroy_primary_surface_async)(QXLWorker *worker, uint32_t surface_id);
> >+    void (*create_primary_surface_async)(QXLWorker *worker, uint32_t surface_id,
> >+                                   QXLDevSurfaceCreate *surface);
> >+    void (*destroy_surface_wait_async)(QXLWorker *worker, uint32_t surface_id);
> >+    void (*oom_async)(QXLWorker *worker);
> 
> I think it would be useful to pass in a magic cookie to the _async
> functions ...
> 
> >+    void (*async_complete)(QXLInstance *qin);
> 
> ... which will be passed back here, to make it easier for the caller
> to figure which async call was just finished?  I'd suggest intptr_t
> or uint64_t as type.

ok, good idea, I'll use uint64_t then (just seems simpler to use).

> 
> While we are busy updating the interface: can we please also add a
> callback which is called by spice server each time it updates a
> surface in qxl device memory?
you mean whenever we render something? I guess I'll allow it to be
NULL at first cause I don't want to bother implementing it on the other
side atm. Let's settle on the signature since I'm not even sure where
you'd want to call it - for every render operation I presume, but sounds like
a bit too much (but again, I'm not sure why you want that anyway).

void (*surface_updated)(QXLInstance *qxl, uint32_t surface_id, struct QXLRect *rect)

?

> 
> Oh, and the minor version of the qxl interface must be updated too.
> Likewise the minor version of the shared library.
> 
will do.

> cheers,
>   Gerd


More information about the Spice-devel mailing list