[PATCH] [rfc] push don't render sw cursor/sigio avoidance hack down

Keith Packard keithp at keithp.com
Wed May 30 14:35:15 PDT 2012


> -static void
> +static Bool
>  xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
>  {
>      xf86CursorScreenPtr ScreenPriv =
>          (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
>                                                 xf86CursorScreenKey);
> -
> +    Bool ret;
>      /* only update coordinate state for first sprite, otherwise we get jumps
>         when removing a sprite. The second sprite is never HW rendered anyway */
>      if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer) {
> @@ -408,15 +414,25 @@ xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
>          ScreenPriv->y = y;
>  
>          if (ScreenPriv->CursorToRestore)
> -            xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CursorToRestore, x,
> +            ret = xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CursorToRestore, x,
>                                  y);
>          else if (ScreenPriv->SWCursor)
> -            (*ScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
> -        else if (ScreenPriv->isUp)
> +            if (input_in_sigio == 1)
> +                ret = FALSE;
> +            else
> +                ret = (*ScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
> +        else if (ScreenPriv->isUp) {
>              xf86MoveCursor(pScreen, x, y);
> +            ret = TRUE;
> +        }
> +        return ret;
> +    }
> +    else {
> +        if (input_in_sigio)
> +            return FALSE;
> +        else
> +            return (*ScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
>      }
> -    else
> -        (*ScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
>  }

Weird mix of 'return' and 'ret =' in this function. Pick one style please.


> -        (*pScreenPriv->spriteFuncs->SetCursor)
> +        ret = (*pScreenPriv->spriteFuncs->SetCursor)
>              (pDev, pScreen, pPointer->pCursor, x, y);
> -        pPointer->devx = x;
> -        pPointer->devy = y;
> -        pPointer->pSpriteCursor = pPointer->pCursor;
> -        pPointer->pSpriteScreen = pScreen;
> +        if (ret == FALSE) {
> +            pPointer->devx = x;
> +            pPointer->devy = y;
> +            pPointer->pSpriteCursor = pPointer->pCursor;
> +            pPointer->pSpriteScreen = pScreen;
> +        }

Is 'ret == FALSE' correct here? Seems like you're updating the pointer
when the device *didn't* move the sprite?


> +        ret = (*pScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCursor, x, y);
> +        if (ret == TRUE) {
> +            pPointer->devx = x;
> +            pPointer->devy = y;
> +            pPointer->pSpriteCursor = pPointer->pCursor;
> +        }

This case updates it when the driver *does* move the sprite. I'm so confused.

Looks like a nice cleanup though.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20120530/476e739b/attachment.pgp>


More information about the xorg-devel mailing list