xf86-video-ati: Branch 'pci-rework'

George Sapountzis gsap7 at kemper.freedesktop.org
Sun Mar 18 02:01:01 EET 2007


 src/atipreinit.c |   45 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 39 insertions(+), 6 deletions(-)

New commits:
diff-tree bfc310f1684bb3f5971366e41a86ef25a9f3282e (from aec1ab0a365786223a0c713764aa705e443126ba)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sun Mar 18 01:49:28 2007 +0200

    [mach64] Recompute I/O bases after BIOS initialisation in case they were invalidated.
    
    This partially reverts commit 5021e6ae0ab2351baf2105c17776e75a8e406e90 .

diff --git a/src/atipreinit.c b/src/atipreinit.c
index 0dc6d9a..9f88ddc 100644
--- a/src/atipreinit.c
+++ b/src/atipreinit.c
@@ -422,12 +422,45 @@ ATIPreInit
 
     /* Finish probing the adapter */
     {
-            /*
-             * For MMIO, the MMIO address is set by ATIMach64ProbeIO().
-             * For CPIO, the MMIO address is set when we read the adapter's
-             * linear aperture configuration, this mapping is a no-op.
-             */
-            ATIMach64Map(pScreenInfo->scrnIndex, pATI);
+        /* I/O bases might no longer be valid after BIOS initialisation */
+
+        /* Set CPIO address from PCI configuration space for block I/O */
+        if (pATI->CPIODecoding == BLOCK_IO)
+            pATI->CPIOBase = PCI_REGION_BASE(pVideo, 1, REGION_IO);
+
+        /* Set MMIO address from PCI configuration space, if available */
+        if ((pATI->Block0Base = PCI_REGION_BASE(pVideo, 2, REGION_MEM)))
+        {
+            pATI->Block0Base += 0x0400U;
+        }
+
+            do
+            {
+                /*
+                 * Find and mmap() MMIO area.  Allow only auxiliary aperture if
+                 * it exists.
+                 */
+                if (!pATI->Block0Base)
+                {
+                        /* Check tail end of linear (8MB or 4MB) aperture */
+                        if ((pATI->Block0Base = PCI_REGION_BASE(pVideo, 0, REGION_MEM)))
+                        {
+                            pATI->MMIOInLinear = TRUE;
+
+                            pATI->Block0Base += 0x007FFC00U;
+                            ATIMach64Map(pScreenInfo->scrnIndex, pATI);
+                            if (pATI->pBlock[0])
+                                break;
+
+                            pATI->Block0Base -= 0x00400000U;
+                            ATIMach64Map(pScreenInfo->scrnIndex, pATI);
+                            if (pATI->pBlock[0])
+                                break;
+                        }
+                }
+
+                ATIMach64Map(pScreenInfo->scrnIndex, pATI);
+            } while (0);
 
 #ifdef AVOID_CPIO
 



More information about the xorg-commit mailing list