diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-06 11:50:20 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-06 11:50:20 +0930 |
commit | 3df88c17e315b5ae580096e4bc88920d1f452e83 (patch) | |
tree | 3242d5aab3486a25effb9b749e638cea96fdb725 /hw/xfree86/ramdac/xf86Cursor.c | |
parent | 6f63724b28c8b3fd85314fb95d1e4f363b610e19 (diff) |
xfree86: re-enable hardware cursor (for a single cursor)
This commit enables HW rendering for cursors again, but only for a single
cursor. Other cursors can be created, however they will not be visible.
Diffstat (limited to 'hw/xfree86/ramdac/xf86Cursor.c')
-rw-r--r-- | hw/xfree86/ramdac/xf86Cursor.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index 5c909c7c4..61fb0ed58 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -26,12 +26,18 @@ static Bool xf86CursorRealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); static Bool xf86CursorUnrealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); static void xf86CursorSetCursor(DeviceIntPtr, ScreenPtr, CursorPtr, int, int); static void xf86CursorMoveCursor(DeviceIntPtr, ScreenPtr, int, int); +static Bool xf86DeviceCursorInitialize(DeviceIntPtr, ScreenPtr); +static void xf86DeviceCursorCleanup(DeviceIntPtr, ScreenPtr); +static void xf86DeviceCursorUndisplay(DeviceIntPtr, ScreenPtr); static miPointerSpriteFuncRec xf86CursorSpriteFuncs = { xf86CursorRealizeCursor, xf86CursorUnrealizeCursor, xf86CursorSetCursor, - xf86CursorMoveCursor + xf86CursorMoveCursor, + xf86DeviceCursorInitialize, + xf86DeviceCursorCleanup, + xf86DeviceCursorUndisplay }; /* Screen functions */ @@ -420,3 +426,43 @@ xf86DestroyCursorInfoRec(xf86CursorInfoPtr infoPtr) { xfree(infoPtr); } + +/** + * New cursor has been created. Do your initalizations here. + */ +static Bool +xf86DeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) +{ + xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, xf86CursorScreenKey); + + /* Init SW cursor */ + return (*ScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScreen); +} + +/** + * Cursor has been removed. Clean up after yourself. + */ +static void +xf86DeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) +{ + xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, xf86CursorScreenKey); + + /* Clean up SW cursor */ + (*ScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen); +} + +/** + * Called on server shutdown to remove all cursors from the screen before + * bringing the server down. + */ +static void +xf86DeviceCursorUndisplay(DeviceIntPtr pDev, ScreenPtr pScreen) +{ + xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, xf86CursorScreenKey); + + /* Undisplay SW cursor */ + (*ScreenPriv->spriteFuncs->UndisplayCursor)(pDev, pScreen); +} |