[Spice-devel] [PATCH qxl-win v3] miniport/qxl: implement SetPowerState:VideoPowerOn

Alon Levy alevy at redhat.com
Thu Jul 7 02:43:14 PDT 2011


---
 miniport/qxl.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/miniport/qxl.c b/miniport/qxl.c
index 89e2075..7d6429d 100644
--- a/miniport/qxl.c
+++ b/miniport/qxl.c
@@ -718,13 +718,20 @@ void HWReset(QXLExtension *dev_ext);
 #pragma alloc_text(PAGE, HWReset)
 #endif
 
+/* called from HWReset or after returning from sleep from SetPowerState,
+ * when returning from sleep we don't want to do a redundant QXL_IO_RESET */
+static void ResetDeviceWithoutIO(QXLExtension *dev_ext)
+{
+    dev_ext->ram_header->int_mask = ~0;
+    CreateMemSlots(dev_ext);
+}
+
 void HWReset(QXLExtension *dev_ext)
 {
     PAGED_CODE();
     DEBUG_PRINT((0, "%s\n", __FUNCTION__));
     VideoPortWritePortUchar((PUCHAR)dev_ext->io_base + QXL_IO_RESET, 0);
-    dev_ext->ram_header->int_mask = ~0;
-    CreateMemSlots(dev_ext);
+    ResetDeviceWithoutIO(dev_ext);
     DEBUG_PRINT((0, "%s: done\n", __FUNCTION__));
 }
 
@@ -775,6 +782,8 @@ VP_STATUS SetPowerState(PVOID dev_extension,
     case DISPLAY_ADAPTER_HW_ID:
         switch (pm_stat->PowerState) {
         case VideoPowerOn:
+            ResetDeviceWithoutIO(dev_ext);
+            break;
         case VideoPowerStandBy:
         case VideoPowerSuspend:
         case VideoPowerOff:
-- 
1.7.5.4



More information about the Spice-devel mailing list