From 2c8b33b761e4411451aea1eea3a89d629aeea40d Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Tue, 21 Nov 2006 04:51:02 +0200 Subject: Minor refactoring of pATI->Block0Base computation. --- src/atipreinit.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'src/atipreinit.c') 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 -- cgit v1.2.3