diff options
Diffstat (limited to 'ui/spice-display.c')
-rw-r--r-- | ui/spice-display.c | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c index af10ae8a6f..683d45429f 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -62,10 +62,18 @@ void qemu_spice_rect_union(QXLRect *dest, const QXLRect *r) dest->right = MAX(dest->right, r->right); } - -void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot) -{ - ssd->worker->add_memslot(ssd->worker, memslot); +void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot, + qxl_async_io async) +{ + if (async != QXL_SYNC) { +#if SPICE_INTERFACE_QXL_MINOR >= 1 + spice_qxl_add_memslot_async(&ssd->qxl, memslot, 0); +#else + abort(); +#endif + } else { + ssd->worker->add_memslot(ssd->worker, memslot); + } } void qemu_spice_del_memslot(SimpleSpiceDisplay *ssd, uint32_t gid, uint32_t sid) @@ -74,14 +82,33 @@ void qemu_spice_del_memslot(SimpleSpiceDisplay *ssd, uint32_t gid, uint32_t sid) } void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id, - QXLDevSurfaceCreate *surface) -{ - ssd->worker->create_primary_surface(ssd->worker, id, surface); + QXLDevSurfaceCreate *surface, + qxl_async_io async) +{ + if (async != QXL_SYNC) { +#if SPICE_INTERFACE_QXL_MINOR >= 1 + spice_qxl_create_primary_surface_async(&ssd->qxl, id, surface, 0); +#else + abort(); +#endif + } else { + ssd->worker->create_primary_surface(ssd->worker, id, surface); + } } -void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id) + +void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd, + uint32_t id, qxl_async_io async) { - ssd->worker->destroy_primary_surface(ssd->worker, id); + if (async != QXL_SYNC) { +#if SPICE_INTERFACE_QXL_MINOR >= 1 + spice_qxl_destroy_primary_surface_async(&ssd->qxl, id, 0); +#else + abort(); +#endif + } else { + ssd->worker->destroy_primary_surface(ssd->worker, id); + } } void qemu_spice_wakeup(SimpleSpiceDisplay *ssd) @@ -198,7 +225,7 @@ void qemu_spice_create_host_memslot(SimpleSpiceDisplay *ssd) memset(&memslot, 0, sizeof(memslot)); memslot.slot_group_id = MEMSLOT_GROUP_HOST; memslot.virt_end = ~0; - qemu_spice_add_memslot(ssd, &memslot); + qemu_spice_add_memslot(ssd, &memslot, QXL_SYNC); } void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd) @@ -218,14 +245,14 @@ void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd) surface.mem = (intptr_t)ssd->buf; surface.group_id = MEMSLOT_GROUP_HOST; - qemu_spice_create_primary_surface(ssd, 0, &surface); + qemu_spice_create_primary_surface(ssd, 0, &surface, QXL_SYNC); } void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd) { dprint(1, "%s:\n", __FUNCTION__); - qemu_spice_destroy_primary_surface(ssd, 0); + qemu_spice_destroy_primary_surface(ssd, 0, QXL_SYNC); } void qemu_spice_vm_change_state_handler(void *opaque, int running, int reason) |