xf86Cursor: Add xf86CheckHWCursor() helper function
This is a preparation patch for adding prime hw-cursor support. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
2eefb53f58
commit
71fecc84e9
|
@ -339,14 +339,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
||||||
|
|
||||||
if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) &&
|
if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) &&
|
||||||
(ScreenPriv->ForceHWCursorCount ||
|
(ScreenPriv->ForceHWCursorCount ||
|
||||||
((
|
xf86CheckHWCursor(pScreen, cursor, infoPtr))) {
|
||||||
cursor->bits->argb &&
|
|
||||||
infoPtr->UseHWCursorARGB &&
|
|
||||||
(*infoPtr->UseHWCursorARGB)(pScreen, cursor)) ||
|
|
||||||
(cursor->bits->argb == 0 &&
|
|
||||||
(cursor->bits->height <= infoPtr->MaxHeight) &&
|
|
||||||
(cursor->bits->width <= infoPtr->MaxWidth) &&
|
|
||||||
(!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) {
|
|
||||||
|
|
||||||
if (ScreenPriv->SWCursor) /* remove the SW cursor */
|
if (ScreenPriv->SWCursor) /* remove the SW cursor */
|
||||||
(*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen,
|
(*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen,
|
||||||
|
|
|
@ -43,6 +43,7 @@ void xf86MoveCursor(ScreenPtr pScreen, int x, int y);
|
||||||
void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed);
|
void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed);
|
||||||
Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr);
|
Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr);
|
||||||
|
|
||||||
|
Bool xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr);
|
||||||
extern _X_EXPORT DevPrivateKeyRec xf86CursorScreenKeyRec;
|
extern _X_EXPORT DevPrivateKeyRec xf86CursorScreenKeyRec;
|
||||||
|
|
||||||
#define xf86CursorScreenKey (&xf86CursorScreenKeyRec)
|
#define xf86CursorScreenKey (&xf86CursorScreenKeyRec)
|
||||||
|
|
|
@ -119,6 +119,18 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(cursor->bits->argb && infoPtr->UseHWCursorARGB &&
|
||||||
|
infoPtr->UseHWCursorARGB(pScreen, cursor)) ||
|
||||||
|
(cursor->bits->argb == 0 &&
|
||||||
|
cursor->bits->height <= infoPtr->MaxHeight &&
|
||||||
|
cursor->bits->width <= infoPtr->MaxWidth &&
|
||||||
|
(!infoPtr->UseHWCursor || infoPtr->UseHWCursor(pScreen, cursor)));
|
||||||
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue