diff options
author | George Sapountzis <gsap7@yahoo.gr> | 2006-11-21 04:51:02 +0200 |
---|---|---|
committer | George Sapountzis <gsap7@yahoo.gr> | 2007-02-05 19:28:59 +0200 |
commit | 2c8b33b761e4411451aea1eea3a89d629aeea40d (patch) | |
tree | bfa0ec37ebbde68dde42afe3d27ef2cde0da2f69 /src/atipreinit.c | |
parent | a659b7235332e19659c56cc9d7af362bd8885a29 (diff) |
Minor refactoring of pATI->Block0Base computation.
Diffstat (limited to 'src/atipreinit.c')
-rw-r--r-- | src/atipreinit.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/atipreinit.c b/src/atipreinit.c index b9111fc..62c32bb 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -400,22 +400,6 @@ ATIPreInit return TRUE; } - pATI->Block0Base = 0; /* Might no longer be valid */ - if ((pVideo = pATI->PCIInfo)) - { - if (pATI->CPIODecoding == BLOCK_IO) - pATI->CPIOBase = pVideo->ioBase[1]; - - /* Set MMIO address from PCI configuration space, if available */ - if ((pATI->Block0Base = pVideo->memBase[2])) - { - if (pATI->Block0Base >= (CARD32)(-1 << pVideo->size[2])) - pATI->Block0Base = 0; - else - pATI->Block0Base += 0x0400U; - } - } - #ifdef AVOID_CPIO pScreenInfo->racMemFlags = @@ -438,16 +422,29 @@ ATIPreInit /* Finish probing the adapter */ { + + if (pATI->CPIODecoding == BLOCK_IO) + pATI->CPIOBase = pVideo->ioBase[1]; + + /* Set MMIO address from PCI configuration space, if available */ + if ((pATI->Block0Base = pVideo->memBase[2])) + { + if (pATI->Block0Base >= (CARD32)(-1 << pVideo->size[2])) + pATI->Block0Base = 0; + else + pATI->Block0Base += 0x0400U; + } + + Block0Base = pATI->Block0Base; /* save */ + do { /* * Find and mmap() MMIO area. Allow only auxiliary aperture if * it exists. */ - if (!(Block0Base = pATI->Block0Base)) + if (!pATI->Block0Base) { - if (pVideo) - { /* Check tail end of linear (8MB or 4MB) aperture */ if ((pATI->Block0Base = pVideo->memBase[0])) { @@ -461,7 +458,6 @@ ATIPreInit if (pATI->pBlock[0]) break; } - } /* Check VGA MMIO aperture */ pATI->Block0Base = 0x000BFC00U; @@ -469,7 +465,8 @@ ATIPreInit ATIMach64Map(pScreenInfo->scrnIndex, pATI); } while (0); - pATI->Block0Base = Block0Base; + + pATI->Block0Base = Block0Base; /* restore */ #ifdef AVOID_CPIO |