Add function for drivers to change RandR's idea of the virtual screen size.

(This allows drivers to reserve a larger virtual size at start and
    change it later)
This commit is contained in:
Thomas Winischhofer 2005-10-29 21:31:23 +00:00
parent e921eec1c6
commit fdbb3ea609
2 changed files with 56 additions and 13 deletions

View File

@ -427,6 +427,9 @@ void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts);
Bool xf86RandRInit (ScreenPtr pScreen);
void xf86RandRSetInitialMode (ScreenPtr pScreen);
Rotation xf86GetRotation(ScreenPtr pScreen);
Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
int newvirtX, int newvirtY,
int newmmWidth, int newmmHeight, Bool resetMode);
#endif
/* xf86VidModeExtentionInit.c */

View File

@ -326,6 +326,44 @@ xf86GetRotation(ScreenPtr pScreen)
return XF86RANDRINFO(pScreen)->rotation;
}
/* Function to change RandR's idea of the virtual screen size */
Bool
xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
int newvirtX, int newvirtY, int newmmWidth, int newmmHeight,
Bool resetMode)
{
XF86RandRInfoPtr randrp;
if (xf86RandRIndex == -1)
return FALSE;
randrp = XF86RANDRINFO(pScreen);
if (randrp == NULL)
return FALSE;
if (newvirtX > 0)
randrp->virtualX = newvirtX;
if (newvirtY > 0)
randrp->virtualY = newvirtY;
if (newmmWidth > 0)
randrp->mmWidth = newmmWidth;
if (newmmHeight > 0)
randrp->mmHeight = newmmHeight;
/* This is only for during server start */
if (resetMode) {
return (xf86RandRSetMode(pScreen,
XF86SCRNINFO(pScreen)->currentMode,
TRUE,
pScreen->mmWidth, pScreen->mmHeight));
}
return TRUE;
}
Bool
xf86RandRInit (ScreenPtr pScreen)
{
@ -373,3 +411,5 @@ xf86RandRInit (ScreenPtr pScreen)
pScreen->devPrivates[xf86RandRIndex].ptr = randrp;
return TRUE;
}