[Spice-devel] [PATCH v3 2/5] add QXL_IO_FLUSH_{SURFACES, RELEASE} for sleep (S3) support

Alon Levy alevy at redhat.com
Sun Jul 17 03:55:05 PDT 2011


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 files changed, 2 insertions(+), 0 deletions(-)

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
 };
-- 
1.7.6



More information about the Spice-devel mailing list