summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Toutant <ctoutant@matrox.com>2011-12-07 15:42:39 -0500
committerChristian Toutant <ctoutant@matrox.com>2011-12-07 15:42:39 -0500
commit644ba5d11049e63ea61b5cc4fb889b0f840965ff (patch)
tree391c2eb80e2a8fe0f2017bbbe2f9ec06ee7d1335
parentd9cf07a4f424b2beb844ea1b3ec5d468e79a747c (diff)
Add support for Video Memory greater then 8M
Expand memory mapping of framebuffer from 8 to 16MB Fix segfault on redhat distibution Signed-off-by: Christian Toutant <ctoutant@matrox.com>
-rw-r--r--src/mga_driver.c56
1 files changed, 48 insertions, 8 deletions
diff --git a/src/mga_driver.c b/src/mga_driver.c
index d9f6ea4..ae36378 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -2707,9 +2707,18 @@ MGAMapMem(ScrnInfoPtr pScrn)
if (pMga->IOBase == NULL)
return FALSE;
- pMga->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
- pMga->PciTag, pMga->FbAddress,
- pMga->FbMapSize);
+ if (pMga->is_G200ER)
+ {
+ pMga->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+ pMga->PciTag, pMga->FbAddress,
+ pMga->FbMapSize);
+ }
+ else
+ {
+ pMga->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+ pMga->PciTag, pMga->FbAddress,
+ pMga->FbMapSize);
+ }
if (pMga->FbBase == NULL)
return FALSE;
#endif
@@ -3139,11 +3148,19 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pMga = MGAPTR(pScrn);
MGAdac = &pMga->Dac;
- if (pMga->is_G200SE) {
- VRTemp = pScrn->videoRam;
- FBTemp = pMga->FbMapSize;
- pScrn->videoRam = 8192;
- pMga->FbMapSize = pScrn->videoRam * 1024;
+ if (pMga->is_G200SE)
+ {
+ VRTemp = pScrn->videoRam;
+ FBTemp = pMga->FbMapSize;
+ if (pMga->reg_1e24 >= 0x01)
+ {
+ pScrn->videoRam = 16384;
+ }
+ else
+ {
+ pScrn->videoRam = 8192;
+ }
+ pMga->FbMapSize = pScrn->videoRam * 1024;
}
@@ -3701,10 +3718,26 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen)
vgaHWPtr hwp = VGAHWPTR(pScrn);
MGAPtr pMga = MGAPTR(pScrn);
MGAEntPtr pMgaEnt = NULL;
+ CARD32 VRTemp, FBTemp;
if (pMga->MergedFB)
MGACloseScreenMerged(scrnIndex, pScreen);
+ if (pMga->is_G200SE)
+ {
+ VRTemp = pScrn->videoRam;
+ FBTemp = pMga->FbMapSize;
+ if (pMga->reg_1e24 >= 0x01)
+ {
+ pScrn->videoRam = 16384;
+ }
+ else
+ {
+ pScrn->videoRam = 8192;
+ }
+ pMga->FbMapSize = pScrn->videoRam * 1024;
+ }
+
if (pScrn->vtSema) {
if (pMga->FBDev) {
fbdevHWRestore(pScrn);
@@ -3716,6 +3749,13 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen)
vgaHWUnmapMem(pScrn);
}
}
+
+ if (pMga->is_G200SE)
+ {
+ pScrn->videoRam = VRTemp;
+ pMga->FbMapSize = FBTemp;
+ }
+
#ifdef XF86DRI
if (pMga->directRenderingEnabled) {
MGADRICloseScreen(pScreen);