From f63f4b768cd5ec5bffd270e448e6e51b8ad67016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Fri, 13 Aug 2004 18:24:07 +0000 Subject: [PATCH] Fri Aug 13 19:53:10 2004 Soeren Sandmann 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 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. --- hw/xfree86/common/xf86RandR.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index 88e9d371b..58ec739b0 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -38,6 +38,8 @@ typedef struct _xf86RandRInfo { CloseScreenProcPtr CloseScreen; int virtualX; int virtualY; + int mmWidth; + int mmHeight; Rotation rotation; } XF86RandRInfoRec, *XF86RandRInfoPtr; @@ -73,7 +75,7 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) refresh0 = refresh; pSize = RRRegisterSize (pScreen, mode->HDisplay, mode->VDisplay, - pScreen->mmWidth, pScreen->mmHeight); + randrp->mmWidth, randrp->mmHeight); if (!pSize) return FALSE; RRRegisterRate (pScreen, pSize, refresh); @@ -89,8 +91,8 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) mode = scrp->modes; pSize = RRRegisterSize (pScreen, randrp->virtualX, randrp->virtualY, - pScreen->mmWidth * randrp->virtualX / scrp->currentMode->HDisplay, - pScreen->mmHeight * randrp->virtualY / scrp->currentMode->VDisplay); + randrp->mmWidth, + randrp->mmHeight); if (!pSize) return FALSE; RRRegisterRate (pScreen, pSize, refresh0); @@ -117,16 +119,20 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) static Bool xf86RandRSetMode (ScreenPtr pScreen, DisplayModePtr mode, - Bool useVirtual) + Bool useVirtual, + int mmWidth, + int mmHeight) { ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; + int oldmmWidth = pScreen->mmWidth; + int oldmmHeight = pScreen->mmHeight; WindowPtr pRoot = WindowTable[pScreen->myNum]; if (pRoot) - xf86EnableDisableFBAccess (pScreen->myNum, FALSE); + (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); if (useVirtual) { scrp->virtualX = randrp->virtualX; @@ -142,16 +148,22 @@ xf86RandRSetMode (ScreenPtr pScreen, /* If the screen is rotated 90 or 270 degrees, swap the sizes. */ pScreen->width = scrp->virtualY; pScreen->height = scrp->virtualX; + pScreen->mmWidth = mmHeight; + pScreen->mmHeight = mmWidth; } else { pScreen->width = scrp->virtualX; pScreen->height = scrp->virtualY; + pScreen->mmWidth = mmWidth; + pScreen->mmHeight = mmHeight; } if (!xf86SwitchMode (pScreen, mode)) { scrp->virtualX = pScreen->width = oldWidth; scrp->virtualY = pScreen->height = oldHeight; + pScreen->mmWidth = oldmmWidth; + pScreen->mmHeight = oldmmHeight; return FALSE; } /* @@ -165,7 +177,7 @@ xf86RandRSetMode (ScreenPtr pScreen, xf86SetViewport (pScreen, pScreen->width, pScreen->height); xf86SetViewport (pScreen, 0, 0); if (pRoot) - xf86EnableDisableFBAccess (pScreen->myNum, TRUE); + (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE); return TRUE; } @@ -215,7 +227,7 @@ xf86RandRSetConfig (ScreenPtr pScreen, return FALSE; } - if (!xf86RandRSetMode (pScreen, mode, useVirtual)) + if (!xf86RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth, pSize->mmHeight)) return FALSE; /* * Move the cursor back where it belongs; SwitchMode repositions it @@ -307,6 +319,8 @@ xf86RandRInit (ScreenPtr pScreen) randrp->virtualX = scrp->virtualX; randrp->virtualY = scrp->virtualY; + randrp->mmWidth = pScreen->mmWidth; + randrp->mmHeight = pScreen->mmHeight; randrp->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = xf86RandRCreateScreenResources;