xfree86: Re-set current cursor after RandR 1.2 CRTC configuration change

Add xf86CursorResetCursor, which allows switching between HW and SW
cursor depending on the current state.

Call it from xf86DisableUnusedFunctions, which is called after any CRTC
configuration change such as setting a mode or disabling a CRTC. This
makes sure that SW cursor is used e.g. while a transform is in use on
any CRTC or while there are active PRIME output slaves, and enables HW
cursor again once none of those conditions are true anymore.

Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Michel Dänzer 2015-10-21 18:33:46 +09:00 committed by Michel Dänzer
parent a4ffa8721d
commit b04767c84d
3 changed files with 31 additions and 0 deletions

View File

@ -3121,6 +3121,12 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
xf86_crtc_notify(pScrn->pScreen);
if (pScrn->ModeSet)
pScrn->ModeSet(pScrn);
if (pScrn->pScreen) {
if (pScrn->pScreen->isGPU)
xf86CursorResetCursor(pScrn->pScreen->current_master);
else
xf86CursorResetCursor(pScrn->pScreen);
}
}
#ifdef RANDR_12_INTERFACE

View File

@ -385,6 +385,30 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
(*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCurs, x, y);
}
/* Re-set the current cursor. This will switch between hardware and software
* cursor depending on whether hardware cursor is currently supported
* according to the driver.
*/
void
xf86CursorResetCursor(ScreenPtr pScreen)
{
xf86CursorScreenPtr ScreenPriv;
if (!inputInfo.pointer)
return;
if (!dixPrivateKeyRegistered(xf86CursorScreenKey))
return;
ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
xf86CursorScreenKey);
if (!ScreenPriv)
return;
xf86CursorSetCursor(inputInfo.pointer, pScreen, ScreenPriv->CurrentCursor,
ScreenPriv->x, ScreenPriv->y);
}
static void
xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{

View File

@ -59,6 +59,7 @@ extern _X_EXPORT Bool xf86InitCursor(ScreenPtr pScreen,
xf86CursorInfoPtr infoPtr);
extern _X_EXPORT xf86CursorInfoPtr xf86CreateCursorInfoRec(void);
extern _X_EXPORT void xf86DestroyCursorInfoRec(xf86CursorInfoPtr);
extern _X_EXPORT void xf86CursorResetCursor(ScreenPtr pScreen);
extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on);
#define HARDWARE_CURSOR_INVERT_MASK 0x00000001