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

Alon Levy alevy at redhat.com
Thu Jul 7 02:43:24 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 d22ccf9..32b4c9b 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -606,9 +606,11 @@ static VOID CreatePrimarySurface(PDev *pdev, UINT32 depth, UINT32 format,
     async_io(pdev, ASYNCABLE_CREATE_PRIMARY, 0);
 }
 
-static void DestroyPrimarySurface(PDev *pdev)
+static void DestroyPrimarySurface(PDev *pdev, int hide_mouse)
 {
-    HideMouse(pdev);
+    if (hide_mouse) {
+        HideMouse(pdev);
+    }
     async_io(pdev, ASYNCABLE_DESTROY_PRIMARY, 0);
 }
 
@@ -915,12 +917,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;
     }
 }
@@ -937,8 +939,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) {
@@ -966,7 +967,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.4



More information about the Spice-devel mailing list