[PATCH] Work around ScreenPriv->SavedCursor->bits being NULL sometimes on resume.

Matthias Hopf mhopf at suse.de
Fri Sep 4 08:32:45 PDT 2009


---
 hw/xfree86/ramdac/xf86Cursor.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index 6b71f46..95556a0 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -227,8 +227,12 @@ xf86CursorEnableDisableFBAccess(
 	 * Re-set current cursor so drivers can react to FB access having been
 	 * temporarily disabled.
 	 */
-	xf86CursorSetCursor(pDev, pScreen, ScreenPriv->SavedCursor,
-			    ScreenPriv->x, ScreenPriv->y);
+	if (ScreenPriv->SavedCursor->bits)
+	    xf86CursorSetCursor(pDev, pScreen, ScreenPriv->SavedCursor,
+				ScreenPriv->x, ScreenPriv->y);
+	else
+	    xf86DrvMsg(index, X_ERROR,
+		       "ScreenPriv->SavedCursor->bits is NULL. Cannot restore cursor.");
 	ScreenPriv->SavedCursor = NULL;
     }
 }
-- 
1.6.0.2


--x+6KMIRAuhnl3hBn--


More information about the xorg-devel mailing list