Merge branch 'hwcursor' into mpx
This commit is contained in:
commit
7509fb498c
|
@ -20,8 +20,6 @@ extern InputInfo inputInfo;
|
|||
|
||||
DevPrivateKey xf86CursorScreenKey = &xf86CursorScreenKey;
|
||||
|
||||
#define XF86_FORCE_SW_CURSOR (1 << 7)
|
||||
|
||||
/* sprite functions */
|
||||
|
||||
static Bool xf86CursorRealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr);
|
||||
|
@ -299,45 +297,35 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
|||
xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, xf86CursorScreenKey);
|
||||
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
|
||||
miPointerScreenPtr PointPriv;
|
||||
miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, miPointerScreenKey);
|
||||
|
||||
|
||||
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
|
||||
if (ScreenPriv->SWCursor || pDev != inputInfo.pointer)
|
||||
(*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor,
|
||||
x, y);
|
||||
else if (ScreenPriv->isUp) {
|
||||
xf86SetCursor(pScreen, NullCursor, x, y);
|
||||
ScreenPriv->isUp = FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* only update for VCP, otherwise we get cursor jumps when removing a
|
||||
sprite. The second cursor is never HW rendered anyway. */
|
||||
if (pDev == inputInfo.pointer ||
|
||||
(!pDev->isMaster && pDev->u.master == inputInfo.pointer))
|
||||
if (pDev == inputInfo.pointer)
|
||||
{
|
||||
ScreenPriv->CurrentCursor = pCurs;
|
||||
ScreenPriv->x = x;
|
||||
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)(pDev, pScreen, NullCursor,
|
||||
x, y);
|
||||
else if
|
||||
(ScreenPriv->isUp) {
|
||||
xf86SetCursor(pScreen, NullCursor, x, y);
|
||||
ScreenPriv->isUp = FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (pDev == inputInfo.pointer ||
|
||||
(!pDev->isMaster && pDev->u.master == inputInfo.pointer))
|
||||
{
|
||||
ScreenPriv->HotX = pCurs->bits->xhot;
|
||||
ScreenPriv->HotY = pCurs->bits->yhot;
|
||||
}
|
||||
|
||||
PointPriv = (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miPointerScreenKey);
|
||||
if (!(ScreenPriv->SWCursor & XF86_FORCE_SW_CURSOR))
|
||||
{
|
||||
if (!infoPtr->pScrn->vtSema)
|
||||
ScreenPriv->SavedCursor = pCurs;
|
||||
|
||||
if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || ((
|
||||
#ifdef ARGB_CURSOR
|
||||
pCurs->bits->argb && infoPtr->UseHWCursorARGB &&
|
||||
|
@ -346,35 +334,35 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
|||
#endif
|
||||
(pCurs->bits->height <= infoPtr->MaxHeight) &&
|
||||
(pCurs->bits->width <= infoPtr->MaxWidth) &&
|
||||
(!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor)(pScreen, pCurs))))))
|
||||
(!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor)(pScreen, pCurs))))))
|
||||
{
|
||||
|
||||
if (ScreenPriv->SWCursor) /* remove the SW cursor */
|
||||
(*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor, x, y);
|
||||
if (ScreenPriv->SWCursor) /* remove the SW cursor */
|
||||
(*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor, x, y);
|
||||
|
||||
xf86SetCursor(pScreen, pCurs, x, y);
|
||||
ScreenPriv->SWCursor = FALSE;
|
||||
ScreenPriv->isUp = TRUE;
|
||||
PointPriv->waitForUpdate = !infoPtr->pScrn->silkenMouse;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PointPriv->waitForUpdate = TRUE;
|
||||
|
||||
if (ScreenPriv->isUp) {
|
||||
/* Remove the HW cursor, or make it transparent */
|
||||
if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT) {
|
||||
xf86SetTransparentCursor(pScreen);
|
||||
} else {
|
||||
xf86SetCursor(pScreen, NullCursor, x, y);
|
||||
ScreenPriv->isUp = FALSE;
|
||||
xf86SetCursor(pScreen, pCurs, x, y);
|
||||
ScreenPriv->SWCursor = FALSE;
|
||||
ScreenPriv->isUp = TRUE;
|
||||
PointPriv->waitForUpdate = !infoPtr->pScrn->silkenMouse;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ScreenPriv->SWCursor)
|
||||
ScreenPriv->SWCursor = TRUE;
|
||||
PointPriv->waitForUpdate = TRUE;
|
||||
|
||||
if (ScreenPriv->isUp) {
|
||||
/* Remove the HW cursor, or make it transparent */
|
||||
if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT) {
|
||||
xf86SetTransparentCursor(pScreen);
|
||||
} else {
|
||||
xf86SetCursor(pScreen, NullCursor, x, y);
|
||||
ScreenPriv->isUp = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ScreenPriv->SWCursor)
|
||||
ScreenPriv->SWCursor = TRUE;
|
||||
|
||||
}
|
||||
|
||||
if (pCurs->bits->emptyMask && !ScreenPriv->showTransparent)
|
||||
pCurs = NullCursor;
|
||||
|
@ -391,18 +379,19 @@ xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
|||
/* only update coordinate state for first sprite, otherwise we get jumps
|
||||
when removing a sprite. The second sprite is never HW rendered anyway */
|
||||
if (pDev == inputInfo.pointer ||
|
||||
(!pDev->isMaster && pDev->u.master == inputInfo.pointer))
|
||||
!pDev->isMaster && pDev->u.master == inputInfo.pointer)
|
||||
{
|
||||
ScreenPriv->x = x;
|
||||
ScreenPriv->y = y;
|
||||
}
|
||||
|
||||
if (ScreenPriv->CursorToRestore)
|
||||
xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CursorToRestore, x, y);
|
||||
else if (ScreenPriv->SWCursor)
|
||||
(*ScreenPriv->spriteFuncs->MoveCursor)(pDev, pScreen, x, y);
|
||||
else if (ScreenPriv->isUp)
|
||||
xf86MoveCursor(pScreen, x, y);
|
||||
if (ScreenPriv->CursorToRestore)
|
||||
xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CursorToRestore, x, y);
|
||||
else if (ScreenPriv->SWCursor)
|
||||
(*ScreenPriv->spriteFuncs->MoveCursor)(pDev, pScreen, x, y);
|
||||
else if (ScreenPriv->isUp)
|
||||
xf86MoveCursor(pScreen, x, y);
|
||||
} else
|
||||
(*ScreenPriv->spriteFuncs->MoveCursor)(pDev, pScreen, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -462,16 +451,6 @@ xf86DeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
/* Init SW cursor */
|
||||
ret = (*ScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScreen);
|
||||
|
||||
if (pDev != inputInfo.pointer)
|
||||
{
|
||||
if (!ScreenPriv->SWCursor)
|
||||
{
|
||||
ScreenPriv->spriteFuncs->SetCursor(inputInfo.pointer, pScreen,
|
||||
ScreenPriv->CurrentCursor, ScreenPriv->x, ScreenPriv->y);
|
||||
}
|
||||
ScreenPriv->SWCursor = TRUE | XF86_FORCE_SW_CURSOR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -485,21 +464,7 @@ xf86DeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, xf86CursorScreenKey);
|
||||
|
||||
for (it = inputInfo.devices; it; it = it->next)
|
||||
{
|
||||
if (it->isMaster && it != inputInfo.pointer && it !=
|
||||
inputInfo.keyboard)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!it) /* no other sprites except VCP. restore HW rendering */
|
||||
{
|
||||
ScreenPriv->SWCursor = TRUE;
|
||||
xf86CursorSetCursor(inputInfo.pointer, pScreen,
|
||||
ScreenPriv->CurrentCursor, ScreenPriv->x, ScreenPriv->y);
|
||||
}
|
||||
|
||||
/* Clean up SW cursor */
|
||||
/* Clean up SW cursor */
|
||||
(*ScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen);
|
||||
}
|
||||
|
||||
|
|
|
@ -530,7 +530,11 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
|
|||
|
||||
pPointer = MIPOINTER(pDev);
|
||||
|
||||
if (pDev && pDev->coreEvents
|
||||
/* Hack: We mustn't call into ->MoveCursor for anything but the
|
||||
* VCP, as this may cause a non-HW rendered cursor to be rendered during
|
||||
* SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT.
|
||||
*/
|
||||
if ((pDev == inputInfo.pointer || (!pDev->isMaster && pDev->u.master == inputInfo.pointer))
|
||||
&& !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
|
||||
{
|
||||
pPointer->devx = x;
|
||||
|
|
Loading…
Reference in New Issue
Block a user