[Spice-devel] [PATCH qxl-win] display/driver: DisableQXLPrimarySurface: add hide_mouse parameter (reused in DrvAssertModeDisable later)

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


Cc: Yonit Halperin <yhalperi at redhat.com>
---
 display/driver.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/display/driver.c b/display/driver.c
index 602054e..fa82945 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -606,9 +606,11 @@ static VOID CreatePrimarySurface(PDev *pdev, UINT32 depth, UINT32 format,
     WRITE_PORT_UCHAR(pdev->create_primary_port, 0);
 }
 
-static void DestroyPrimarySurface(PDev *pdev)
+static void DestroyPrimarySurface(PDev *pdev, int hide_mouse)
 {
-    HideMouse(pdev);
+    if (hide_mouse) {
+        HideMouse(pdev);
+    }
     WRITE_PORT_UCHAR(pdev->destroy_primary_port, 0);
 }
 
@@ -901,12 +903,12 @@ err:
     return NULL;
 }
 
-VOID DisableQXLPrimarySurface(PDev *pdev)
+VOID DisableQXLPrimarySurface(PDev *pdev, int hide_mouse)
 {
     DrawArea drawarea;
 
     if (pdev->surf_enable) {
-        DestroyPrimarySurface(pdev);
+        DestroyPrimarySurface(pdev, hide_mouse);
         pdev->surf_enable = FALSE;
     }
 }
@@ -923,8 +925,7 @@ VOID DrvDisableSurface(DHPDEV in_pdev)
 
     DEBUG_PRINT((pdev, 1, "%s: 0x%lx\n", __FUNCTION__, pdev));
 
-    DisableQXLPrimarySurface(pdev);
-
+    DisableQXLPrimarySurface(pdev, 1 /* hide mouse */);
     UnmapFB(pdev);
 
     if (pdev->surf) {
@@ -952,7 +953,7 @@ BOOL DrvAssertMode(DHPDEV in_pdev, BOOL enable)
         EnableQXLPrimarySurface(pdev);
         CreateVRamSlot(pdev);
     } else {
-        DisableQXLPrimarySurface(pdev);
+        DisableQXLPrimarySurface(pdev, 0);
         RemoveVRamSlot(pdev);
     }
     DEBUG_PRINT((pdev, 1, "%s: 0x%lx exit %d\n", __FUNCTION__, pdev, enable));
-- 
1.7.5.2



More information about the Spice-devel mailing list