summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hopf <mhopf@suse.de>2009-09-16 16:03:46 +0200
committerMatthias Hopf <mhopf@suse.de>2009-09-16 16:05:36 +0200
commit3bdf36476179257561b9409c3f49a77640fbb9f9 (patch)
tree649c9530a28f44a6aa529922c5121a3bb2580bef
parentfe31f9c646bc26163497f29c3b833c090df0b3f9 (diff)
Work around sporadic segfault on resume with intel/KMS due to cursor->bits == NULL.
Apparently SavedCursor is sometime tried to be set while already being set.
-rw-r--r--hw/xfree86/modes/xf86Cursors.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index fc4df8477..f4b8be50b 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -461,6 +461,10 @@ xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
+ if (xf86_config->cursor == cursor) {
+ xf86DrvMsg(index, X_ERROR, "Trying to set already set cursor.\n");
+ return FALSE;
+ }
if (xf86_config->cursor)
FreeCursor (xf86_config->cursor, None);
xf86_config->cursor = cursor;
@@ -480,6 +484,10 @@ xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
+ if (xf86_config->cursor == cursor) {
+ xf86DrvMsg(index, X_ERROR, "Trying to set already set cursor.\n");
+ return FALSE;
+ }
if (xf86_config->cursor)
FreeCursor (xf86_config->cursor, None);
xf86_config->cursor = cursor;