50bab4cf0c
Copy from X11:XOrg/xorg-x11-server based on submit request 20273 from user sndirsch OBS-URL: https://build.opensuse.org/request/show/20273 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xorg-x11-server?expand=0&rev=139
69 lines
2.7 KiB
Diff
69 lines
2.7 KiB
Diff
From 1efa035209aea97d452d829e29af2e5f1ac94272 Mon Sep 17 00:00:00 2001
|
|
From: Matthias Hopf <mhopf@suse.de>
|
|
Date: Fri, 4 Sep 2009 17:32:45 +0200
|
|
Subject: [PATCH] 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.
|
|
---
|
|
hw/xfree86/modes/xf86Cursors.c | 8 ++++++++
|
|
hw/xfree86/ramdac/xf86Cursor.c | 17 ++++++++++-------
|
|
2 files changed, 18 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
|
|
index 8c5a94c..3436636 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;
|
|
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
|
|
index 6b71f46..7aa7039 100644
|
|
--- a/hw/xfree86/ramdac/xf86Cursor.c
|
|
+++ b/hw/xfree86/ramdac/xf86Cursor.c
|
|
@@ -209,13 +209,16 @@ xf86CursorEnableDisableFBAccess(
|
|
xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
|
|
&pScreen->devPrivates, xf86CursorScreenKey);
|
|
|
|
- if (!enable && ScreenPriv->CurrentCursor != NullCursor) {
|
|
- CursorPtr currentCursor = ScreenPriv->CurrentCursor;
|
|
- xf86CursorSetCursor(pDev, pScreen, NullCursor, ScreenPriv->x,
|
|
- ScreenPriv->y);
|
|
- ScreenPriv->isUp = FALSE;
|
|
- ScreenPriv->SWCursor = TRUE;
|
|
- ScreenPriv->SavedCursor = currentCursor;
|
|
+ if (!enable) {
|
|
+ if (ScreenPriv->CurrentCursor != NullCursor) {
|
|
+ CursorPtr currentCursor = ScreenPriv->CurrentCursor;
|
|
+ xf86CursorSetCursor(pDev, pScreen, NullCursor, ScreenPriv->x,
|
|
+ ScreenPriv->y);
|
|
+ ScreenPriv->isUp = FALSE;
|
|
+ ScreenPriv->SWCursor = TRUE;
|
|
+ ScreenPriv->SavedCursor = currentCursor;
|
|
+ } else
|
|
+ ScreenPriv->SavedCursor = NULL;
|
|
}
|
|
|
|
if (ScreenPriv->EnableDisableFBAccess)
|
|
--
|
|
1.6.0.2
|
|
|