Fri Aug 13 19:53:10 2004 Soeren Sandmann <sandmann@redhat.com>

Fix for lockups on some versions of Matrox Mystique. #687, Patch from Mike
    Harris.
Call xf86EnableDisableFBAccess though the function pointer instead of
    directly. #1041, Patch from Aaron Plattner.
Swap the phsyical size of the screen when rotiation. #1050, Patch from
    Aaron Plattner.
Fri Aug 13 19:47:12 2004 Soeren Sandmann <sandmann@redhat.com>
Make HAVE_FT_BITMAP_SIZE_Y_PPEM conditional on the FreeType version instead
    of proping it. This way it will work with the monolithic version too.
    #1062, Patch by Owen Taylor.
This commit is contained in:
Søren Sandmann Pedersen 2004-08-13 18:24:07 +00:00
parent a29bfbd3d0
commit f63f4b768c

View File

@ -38,6 +38,8 @@ typedef struct _xf86RandRInfo {
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;
int virtualX; int virtualX;
int virtualY; int virtualY;
int mmWidth;
int mmHeight;
Rotation rotation; Rotation rotation;
} XF86RandRInfoRec, *XF86RandRInfoPtr; } XF86RandRInfoRec, *XF86RandRInfoPtr;
@ -73,7 +75,7 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
refresh0 = refresh; refresh0 = refresh;
pSize = RRRegisterSize (pScreen, pSize = RRRegisterSize (pScreen,
mode->HDisplay, mode->VDisplay, mode->HDisplay, mode->VDisplay,
pScreen->mmWidth, pScreen->mmHeight); randrp->mmWidth, randrp->mmHeight);
if (!pSize) if (!pSize)
return FALSE; return FALSE;
RRRegisterRate (pScreen, pSize, refresh); RRRegisterRate (pScreen, pSize, refresh);
@ -89,8 +91,8 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
mode = scrp->modes; mode = scrp->modes;
pSize = RRRegisterSize (pScreen, pSize = RRRegisterSize (pScreen,
randrp->virtualX, randrp->virtualY, randrp->virtualX, randrp->virtualY,
pScreen->mmWidth * randrp->virtualX / scrp->currentMode->HDisplay, randrp->mmWidth,
pScreen->mmHeight * randrp->virtualY / scrp->currentMode->VDisplay); randrp->mmHeight);
if (!pSize) if (!pSize)
return FALSE; return FALSE;
RRRegisterRate (pScreen, pSize, refresh0); RRRegisterRate (pScreen, pSize, refresh0);
@ -117,16 +119,20 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
static Bool static Bool
xf86RandRSetMode (ScreenPtr pScreen, xf86RandRSetMode (ScreenPtr pScreen,
DisplayModePtr mode, DisplayModePtr mode,
Bool useVirtual) Bool useVirtual,
int mmWidth,
int mmHeight)
{ {
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
int oldWidth = pScreen->width; int oldWidth = pScreen->width;
int oldHeight = pScreen->height; int oldHeight = pScreen->height;
int oldmmWidth = pScreen->mmWidth;
int oldmmHeight = pScreen->mmHeight;
WindowPtr pRoot = WindowTable[pScreen->myNum]; WindowPtr pRoot = WindowTable[pScreen->myNum];
if (pRoot) if (pRoot)
xf86EnableDisableFBAccess (pScreen->myNum, FALSE); (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
if (useVirtual) if (useVirtual)
{ {
scrp->virtualX = randrp->virtualX; scrp->virtualX = randrp->virtualX;
@ -142,16 +148,22 @@ xf86RandRSetMode (ScreenPtr pScreen,
/* If the screen is rotated 90 or 270 degrees, swap the sizes. */ /* If the screen is rotated 90 or 270 degrees, swap the sizes. */
pScreen->width = scrp->virtualY; pScreen->width = scrp->virtualY;
pScreen->height = scrp->virtualX; pScreen->height = scrp->virtualX;
pScreen->mmWidth = mmHeight;
pScreen->mmHeight = mmWidth;
} }
else else
{ {
pScreen->width = scrp->virtualX; pScreen->width = scrp->virtualX;
pScreen->height = scrp->virtualY; pScreen->height = scrp->virtualY;
pScreen->mmWidth = mmWidth;
pScreen->mmHeight = mmHeight;
} }
if (!xf86SwitchMode (pScreen, mode)) if (!xf86SwitchMode (pScreen, mode))
{ {
scrp->virtualX = pScreen->width = oldWidth; scrp->virtualX = pScreen->width = oldWidth;
scrp->virtualY = pScreen->height = oldHeight; scrp->virtualY = pScreen->height = oldHeight;
pScreen->mmWidth = oldmmWidth;
pScreen->mmHeight = oldmmHeight;
return FALSE; return FALSE;
} }
/* /*
@ -165,7 +177,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
xf86SetViewport (pScreen, pScreen->width, pScreen->height); xf86SetViewport (pScreen, pScreen->width, pScreen->height);
xf86SetViewport (pScreen, 0, 0); xf86SetViewport (pScreen, 0, 0);
if (pRoot) if (pRoot)
xf86EnableDisableFBAccess (pScreen->myNum, TRUE); (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE);
return TRUE; return TRUE;
} }
@ -215,7 +227,7 @@ xf86RandRSetConfig (ScreenPtr pScreen,
return FALSE; return FALSE;
} }
if (!xf86RandRSetMode (pScreen, mode, useVirtual)) if (!xf86RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth, pSize->mmHeight))
return FALSE; return FALSE;
/* /*
* Move the cursor back where it belongs; SwitchMode repositions it * Move the cursor back where it belongs; SwitchMode repositions it
@ -307,6 +319,8 @@ xf86RandRInit (ScreenPtr pScreen)
randrp->virtualX = scrp->virtualX; randrp->virtualX = scrp->virtualX;
randrp->virtualY = scrp->virtualY; randrp->virtualY = scrp->virtualY;
randrp->mmWidth = pScreen->mmWidth;
randrp->mmHeight = pScreen->mmHeight;
randrp->CreateScreenResources = pScreen->CreateScreenResources; randrp->CreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = xf86RandRCreateScreenResources; pScreen->CreateScreenResources = xf86RandRCreateScreenResources;