From fbf2cfb145783dd77df6fbb7056269e7756e8eb9 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 22 May 2011 14:52:11 +0300 Subject: add QXL_IO_FLUSH_{SURFACES,RELEASE} for sleep (S3) support related RHBZ: 688883 Guest initiated sleep looks like this: Guest: (0) stop putting new commands into the rings (1) QXL_IO_FLUSH_SURFACES qxl calls flush_surfaces(), spice-server flushes command rings and renders all surfaces, thereby flushing state to device memory. (2) QXL_IO_DESTROY_ALL_SURFACES zap surfaces (3) QXL_IO_FLUSH_RELEASE push release queue head into the release ring, so the guest will see it and can release everything. (4) tell acpi to reset Qemu: (5) qxl_reset_handler Guest: (6) sends surface create commands The QXL_IO_FLUSH_SURFACES is an optimization, to reduce vmexits. It is used to flush both command rings and update all surfaces at once (equivalent to UPDATE_AREA X NUM_ACTIVE_SURFACES) destroy all surfaces to release resources but not destroy the guest side surfaces get device to flush all server released resources to the release ring (could use multiple calls to OOM - but this is not well defined, would need to loop) After (1) there will be no memory allocated on the pci bars. --- spice/qxl_dev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h index 10ecabd..82eb1c8 100644 --- a/spice/qxl_dev.h +++ b/spice/qxl_dev.h @@ -87,6 +87,8 @@ enum { QXL_IO_DESTROY_PRIMARY_ASYNC, QXL_IO_DESTROY_SURFACE_ASYNC, QXL_IO_DESTROY_ALL_SURFACES_ASYNC, + QXL_IO_FLUSH_SURFACES_ASYNC, + QXL_IO_FLUSH_RELEASE, QXL_IO_RANGE_SIZE }; -- cgit v1.2.3