diff options
author | George Sapountzis <gsap7@yahoo.gr> | 2006-11-20 15:09:41 +0200 |
---|---|---|
committer | George Sapountzis <gsap7@yahoo.gr> | 2007-01-28 01:24:21 +0200 |
commit | c9a9ea5ebd1c27881c1fac19842cfa3af55c126e (patch) | |
tree | 932242627308bbefcf8ee59cde16a512eecd5f97 /src/atipreinit.c | |
parent | 383e963e275d351ea3631c352f5795340162d69f (diff) |
Banked memory is no longer needed.
- (pATI->BankInfo.BankSize = 0) in all cases, cull pATI->BankInfo
- only keep the minimal pATIHW.SetBank interface for save/restore
- clean ATISwap() a little, (NewHW.crtc != ATI_CRTC_VGA)
- (UseSmallApertures == TRUE) <=> pATI->VGAAdapter
Diffstat (limited to 'src/atipreinit.c')
-rw-r--r-- | src/atipreinit.c | 80 |
1 files changed, 16 insertions, 64 deletions
diff --git a/src/atipreinit.c b/src/atipreinit.c index 7d77eecd..9b48eb0f 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -472,16 +472,6 @@ ATIPreInit /* Finish private area initialisation */ pATI->DAC = ATI_DAC_GENERIC; -#ifndef AVOID_CPIO - - pATI->NewHW.SetBank = ATIx8800SetBank; - pATI->BankInfo.SetSourceBank = ATIx8800SetRead; - pATI->BankInfo.SetDestinationBank = ATIx8800SetWrite; - pATI->BankInfo.SetSourceAndDestinationBanks = ATIx8800SetReadWrite; - pATI->BankInfo.BankSize = 0x00010000U; /* 64kB */ - -#endif /* AVOID_CPIO */ - pATI->LCDPanelID = -1; pATI->nFIFOEntries = 16; /* For now */ pATI->Audio = ATI_AUDIO_NONE; @@ -2000,24 +1990,6 @@ ATIPreInit } } -#ifndef AVOID_CPIO - - if (pATI->VGAAdapter) - { - pATI->UseSmallApertures = TRUE; - - /* Set banking functions */ - { - pATI->NewHW.SetBank = ATIMach64SetBankPacked; - pATI->BankInfo.SetSourceBank = ATIMach64SetReadPacked; - pATI->BankInfo.SetDestinationBank = ATIMach64SetWritePacked; - pATI->BankInfo.SetSourceAndDestinationBanks = - ATIMach64SetReadWritePacked; - } - } - -#endif /* AVOID_CPIO */ - if (!pATI->LinearBase || !pATI->LinearSize) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, @@ -2104,40 +2076,36 @@ ATIPreInit if (!pATI->VGAAdapter) { + pATI->NewHW.SetBank = ATIx8800SetBank; + pATI->NewHW.nPlane = 0; + pATIHW->crtc = pATI->NewHW.crtc; pATIHW->SetBank = (ATIBankProcPtr)NoopDDA; - pATI->BankInfo.BankSize = 0; /* No banking */ } else { + Bool ext_disp_en = (pATI->LockData.crtc_gen_cntl & CRTC_EXT_DISP_EN); + Bool vga_ap_en = (pATI->LockData.config_cntl & CFG_MEM_VGA_AP_EN); + Bool vga_color_256 = (GetReg(SEQX, 0x04U) & 0x08U); + + pATI->NewHW.SetBank = ATIMach64SetBankPacked; + pATI->NewHW.nPlane = 1; + pATIHW->crtc = ATI_CRTC_VGA; - if ((pATI->LockData.crtc_gen_cntl & CRTC_EXT_DISP_EN)) - { - pATIHW->crtc = ATI_CRTC_MACH64; - } - { - pATI->BankInfo.nBankDepth = pATI->depth; - pATI->NewHW.nPlane = 1; - } + if (ext_disp_en) + pATIHW->crtc = ATI_CRTC_MACH64; - if ((pATIHW->crtc != ATI_CRTC_VGA) || (GetReg(SEQX, 0x04U) & 0x08U)) + if ((pATIHW->crtc != ATI_CRTC_VGA) || vga_color_256) pATIHW->nPlane = 1; else pATIHW->nPlane = 4; - pATIHW->nBank = ATIDivide(pATI->VideoRAM, - pATIHW->nPlane * pATI->BankInfo.BankSize, 10, 1); - pATI->NewHW.nBank = ATIDivide(pATI->VideoRAM, - pATI->NewHW.nPlane * pATI->BankInfo.BankSize, 10, 1); + /* VideoRAM is a multiple of 512kB and BankSize is 64kB */ + pATIHW->nBank = pATI->VideoRAM / (pATIHW->nPlane * 0x40U); - if (!pATI->UseSmallApertures) - { - pATIHW->SetBank = pATI->NewHW.SetBank; - } - else if ((pATIHW->crtc == ATI_CRTC_VGA) && - !(pATI->LockData.config_cntl & CFG_MEM_VGA_AP_EN)) + if ((pATIHW->crtc == ATI_CRTC_VGA) && !vga_ap_en) { pATIHW->SetBank = (ATIBankProcPtr)NoopDDA; pATIHW->nBank = 1; @@ -2150,10 +2118,6 @@ ATIPreInit { pATIHW->SetBank = ATIMach64SetBankPlanar; } - - if (((ApertureSize * pATI->depth) / pATI->BankInfo.nBankDepth) >= - (unsigned)(pScreenInfo->videoRam * 1024)) - pATI->BankInfo.BankSize = 0; /* No banking */ } #else /* AVOID_CPIO */ @@ -2168,18 +2132,6 @@ ATIPreInit { /* Until ShadowFB becomes a true screen wrapper, if it ever does... */ -#ifndef AVOID_CPIO - - if (pATI->BankInfo.BankSize) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Cannot shadow a banked frame buffer.\n"); - pATI->OptionShadowFB = FALSE; - } - else - -#endif /* AVOID_CPIO */ - if (pATI->OptionAccel) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, |