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

Alon Levy alevy at redhat.com
Mon Jun 20 03:59:28 PDT 2011


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

diff --git a/miniport/qxl.c b/miniport/qxl.c
index 6e9bd8e..37def2d 100644
--- a/miniport/qxl.c
+++ b/miniport/qxl.c
@@ -699,13 +699,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__));
 }
 
@@ -756,6 +763,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.2



More information about the Spice-devel mailing list