summaryrefslogtreecommitdiff
path: root/src/mga_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mga_driver.c')
-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);