Fix an occasional crash on VT switches: the server would save a pointer to

the current cursor when disabling FB access and would try to restore
    that cursor when re-enabling. However, that cursor might have been
    destroyed in between. This fixes it by updating the saved cursor
    pointer when a cursor is set and vtSema is FALSE.
This commit is contained in:
Benjamin Herrenschmidt 2006-02-16 06:52:12 +00:00
parent c845e152f5
commit c8acb34269
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2006-02-16 Benjamin Herrenschmidt <benh@kernel.crashing.org>
* hw/xfree86/ramdac/xf86Cursor.c:
(xf86CursorEnableDisableFBAccess), (xf86CursorSetCursor):
Fix an occasional crash on VT switches: the server would save a
pointer to the current cursor when disabling FB access and would try
to restore that cursor when re-enabling. However, that cursor might
have been destroyed in between. This fixes it by updating the saved
cursor pointer when a cursor is set and vtSema is FALSE.
2006-02-15 Eric Anholt <anholt@FreeBSD.org>
* XTrap/Makefile.am:

View File

@ -198,7 +198,6 @@ xf86CursorEnableDisableFBAccess(
ScreenPtr pScreen = screenInfo.screens[index];
xf86CursorScreenPtr ScreenPriv =
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
if (!enable && ScreenPriv->CurrentCursor != NullCursor) {
ScreenPriv->SavedCursor = ScreenPriv->CurrentCursor;
@ -291,6 +290,9 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
ScreenPriv->y = y;
ScreenPriv->CursorToRestore = NULL;
if (!infoPtr->pScrn->vtSema)
ScreenPriv->SavedCursor = pCurs;
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
if (ScreenPriv->SWCursor)
(*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);