Adds a new revision to notify of this new IO to the driver. This
new revision (QXL_REVISION_STABLE_V10) will also include other IO
updates for async IO.

related RHBZ: 688883

Sleep is supported by the following flow:
    (G stands for Guest, D is the device)
 G: (1#) QXL_IO_UPDATE_MEM(QXL_UPDATE_MEM_RENDER_ALL)
 G: destroy all surfaces, release all memory references
 G: (2#) QXL_IO_UPDATE_MEM(QXL_UPDATE_MEM_FLUSH)
 G: acpi reset
 D: qxl_reset_handler
 G: sends surface create commands

The UPDATE_MEM io port is optimization mostly, to reduce vmexits. It is used to:
 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 the two calls (1# and 2# above) there will be no memory allocated on the 
pci bars.

Adds #define FEATURE_QXL_IO_UPDATE_MEM for qemu/hw/qxl.c to check for, to not 
require
a version bump.
---
 spice/qxl_dev.h |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h
index e3e0696..4449f61 100644
--- a/spice/qxl_dev.h
+++ b/spice/qxl_dev.h
@@ -43,8 +43,12 @@
 
 /* 0x100-0x11f reserved for spice, 0x1ff used for unstable work */
 #define QXL_DEVICE_ID_STABLE 0x0100
-#define QXL_REVISION_STABLE_V04 0x01
-#define QXL_REVISION_STABLE_V06 0x02
+
+enum {
+    QXL_REVISION_STABLE_V04=0x01,
+    QXL_REVISION_STABLE_V06=0x02,
+    QXL_REVISION_STABLE_V10=0x03
+};
 
 #define QXL_DEVICE_ID_DEVEL 0x01ff
 #define QXL_REVISION_DEVEL 0x01
@@ -61,6 +65,9 @@ enum {
     QXL_PCI_RANGES
 };
 
+/* flag for qemu to check for availability of this io port */
+#define FEATURE_QXL_IO_UPDATE_MEM
+
 /* qxl-1 compat: append only */
 enum {
     QXL_IO_NOTIFY_CMD,
@@ -80,10 +87,18 @@ enum {
     QXL_IO_DESTROY_PRIMARY,
     QXL_IO_DESTROY_SURFACE_WAIT,
     QXL_IO_DESTROY_ALL_SURFACES,
+    /* qxl-3 onwards (sleep support) */
+    QXL_IO_UPDATE_MEM,
 
     QXL_IO_RANGE_SIZE
 };
 
+/* QXL_IO_UPDATE_MEM values */
+enum {
+    QXL_UPDATE_MEM_RENDER_ALL,
+    QXL_UPDATE_MEM_FLUSH
+};
+
 typedef uint64_t QXLPHYSICAL;
 typedef int32_t QXLFIXED; //fixed 28.4
 
-- 
1.7.5.2

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to