configure.ac                            |   66 
 man/ati.man                             |    2 
 man/r128.man                            |    2 
 man/radeon.man                          |   18 
 src/AtomBios/CD_Operations.c            |  954 ++++++
 src/AtomBios/Decoder.c                  |  235 +
 src/AtomBios/hwserv_drv.c               |  348 ++
 src/AtomBios/includes/CD_Common_Types.h |  154 +
 src/AtomBios/includes/CD_Definitions.h  |   49 
 src/AtomBios/includes/CD_Opcodes.h      |  181 +
 src/AtomBios/includes/CD_Structs.h      |  464 +++
 src/AtomBios/includes/CD_binding.h      |   46 
 src/AtomBios/includes/CD_hw_services.h  |  318 ++
 src/AtomBios/includes/Decoder.h         |   86 
 src/AtomBios/includes/ObjectID.h        |  484 +++
 src/AtomBios/includes/atombios.h        | 4436 ++++++++++++++++++++++++++++++++
 src/AtomBios/includes/regsdef.h         |   25 
 src/Makefile.am                         |   67 
 src/ati.c                               |  859 +-----
 src/ati.h                               |   76 
 src/ati_pciids_gen.h                    |  139 +
 src/atibus.c                            |    1 
 src/atichip.c                           |    4 
 src/atichip.h                           |   30 
 src/aticlock.c                          |   11 
 src/aticonfig.c                         |   23 
 src/aticonsole.c                        |   15 
 src/atidri.c                            |    8 
 src/atii2c.c                            |    3 
 src/atiload.c                           |  173 -
 src/atiload.h                           |   37 
 src/atimach64probe.c                    |  163 -
 src/atimach64probe.h                    |    6 
 src/atimach64version.h                  |   59 
 src/atimach64xv.c                       |    5 
 src/atimisc.c                           |   89 
 src/atimode.c                           |    9 
 src/atimodule.c                         |   39 
 src/atimodule.h                         |   30 
 src/atipcirename.h                      |    3 
 src/atipreinit.c                        |  727 ++---
 src/atiprobe.c                          |  120 
 src/atistruct.h                         |    2 
 src/atombios_crtc.c                     |  426 +++
 src/atombios_output.c                   |  670 ++++
 src/legacy_crtc.c                       | 1793 ++++++++++++
 src/legacy_output.c                     | 1763 ++++++++++++
 src/pcidb/ati_pciids.csv                |  155 +
 src/pcidb/parse_pci_ids.pl              |    8 
 src/r128.h                              |    6 
 src/r128_chipset.h                      |   54 
 src/r128_cursor.c                       |    2 
 src/r128_dri.c                          |   18 
 src/r128_driver.c                       |  285 --
 src/r128_misc.c                         |   13 
 src/r128_probe.c                        |  343 +-
 src/r128_probe.h                        |    9 
 src/r128_video.c                        |    8 
 src/radeon.h                            |  268 -
 src/radeon_accel.c                      |  346 ++
 src/radeon_accelfuncs.c                 |   12 
 src/radeon_atombios.c                   | 2876 ++++++++++++++++++++
 src/radeon_atombios.h                   |  253 +
 src/radeon_atomwrapper.c                |  101 
 src/radeon_atomwrapper.h                |   31 
 src/radeon_bios.c                       |  401 ++
 src/radeon_chipinfo_gen.h               |  155 +
 src/radeon_chipset_gen.h                |  139 +
 src/radeon_commonfuncs.c                |  123 
 src/radeon_crtc.c                       | 1068 +------
 src/radeon_cursor.c                     |  144 -
 src/radeon_display.c                    |  875 ------
 src/radeon_dri.c                        |   19 
 src/radeon_driver.c                     | 3186 +++++++++-------------
 src/radeon_exa.c                        |   17 
 src/radeon_exa_funcs.c                  |   24 
 src/radeon_exa_render.c                 |  390 ++
 src/radeon_macros.h                     |   53 
 src/radeon_misc.c                       |   13 
 src/radeon_mm_i2c.c                     |   14 
 src/radeon_modes.c                      |  105 
 src/radeon_output.c                     | 2744 +++++++------------
 src/radeon_pci_chipset_gen.h            |  139 +
 src/radeon_pci_device_match_gen.h       |  280 ++
 src/radeon_probe.c                      |  230 -
 src/radeon_probe.h                      |  420 ++-
 src/radeon_reg.h                        |  755 +++++
 src/radeon_render.c                     |    4 
 src/radeon_tv.c                         |  417 ++-
 src/radeon_tv.h                         |    5 
 src/radeon_video.c                      |  123 
 src/theatre.h                           |   38 
 src/theatre_detect.h                    |   11 
 93 files changed, 23786 insertions(+), 8112 deletions(-)

New commits:
commit 1302d1b019c8091986aaf9c86b25c1f36a037788
Author: Alex Deucher <[EMAIL PROTECTED](none)>
Date:   Tue Feb 19 00:34:31 2008 -0500

    Bump for 6.8 release

diff --git a/configure.ac b/configure.ac
index cc2b01a..fe4c057 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-ati],
-        6.7.197,
+        6.8.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-ati)
 

commit 830d29e8b280c11e798fb5bf5278bf24ecbac7bf
Author: Alex Deucher <[EMAIL PROTECTED](none)>
Date:   Mon Feb 18 21:17:12 2008 -0500

    ATOM: fix RS6xx connector table parsing and fix some warnings

diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 81d908f..ddd332f 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1442,6 +1442,7 @@ RADEONLookupGPIOLineForDDC(ScrnInfoPtr pScrn, CARD8 id)
     RADEONI2CBusRec i2c;
     CARD8 crev, frev;
 
+    memset(&i2c, 0, sizeof(RADEONI2CBusRec));
     i2c.valid = FALSE;
 
     atomDataPtr = info->atomBIOS->atomDataPtr;
@@ -1468,6 +1469,25 @@ RADEONLookupGPIOLineForDDC(ScrnInfoPtr pScrn, CARD8 id)
     i2c.get_data_mask = (1 <<  gpio.ucDataY_Shift);
     i2c.valid = TRUE;
 
+#if 0
+    ErrorF("mask_clk_reg: 0x%x\n", gpio.usClkMaskRegisterIndex * 4);
+    ErrorF("mask_data_reg: 0x%x\n", gpio.usDataMaskRegisterIndex * 4);
+    ErrorF("put_clk_reg: 0x%x\n", gpio.usClkEnRegisterIndex * 4);
+    ErrorF("put_data_reg: 0x%x\n", gpio.usDataEnRegisterIndex * 4);
+    ErrorF("get_clk_reg: 0x%x\n", gpio.usClkY_RegisterIndex * 4);
+    ErrorF("get_data_reg: 0x%x\n", gpio.usDataY_RegisterIndex * 4);
+    ErrorF("other_clk_reg: 0x%x\n", gpio.usClkA_RegisterIndex * 4);
+    ErrorF("other_data_reg: 0x%x\n", gpio.usDataA_RegisterIndex * 4);
+    ErrorF("mask_clk_mask: %d\n", gpio.ucClkMaskShift);
+    ErrorF("mask_data_mask: %d\n", gpio.ucDataMaskShift);
+    ErrorF("put_clk_mask: %d\n", gpio.ucClkEnShift);
+    ErrorF("put_data_mask: %d\n", gpio.ucDataEnShift);
+    ErrorF("get_clk_mask: %d\n", gpio.ucClkY_Shift);
+    ErrorF("get_data_mask: %d\n", gpio.ucDataY_Shift);
+    ErrorF("other_clk_mask: %d\n", gpio.ucClkA_Shift);
+    ErrorF("other_data_mask: %d\n", gpio.ucDataA_Shift);
+#endif
+
     return i2c;
 }
 
@@ -1479,7 +1499,7 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr 
pScrn)
     unsigned short size;
     atomDataTablesPtr atomDataPtr;
     ATOM_CONNECTOR_OBJECT_TABLE *con_obj;
-    int i, j, ddc_line;
+    int i, j, ddc_line = 0;
 
     atomDataPtr = info->atomBIOS->atomDataPtr;
     if (!rhdAtomGetTableRevisionAndSize((ATOM_COMMON_TABLE_HEADER 
*)(atomDataPtr->Object_Header), &crev, &frev, &size))
@@ -1725,7 +1745,12 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable 
(ScrnInfoPtr pScrn)
 
        info->BiosConnector[i].valid = TRUE;
        info->BiosConnector[i].output_id = ci.sucI2cId.sbfAccess.bfI2C_LineMux;
-       info->BiosConnector[i].devices = (1 << i);
+       if (info->IsIGP && (i == ATOM_DEVICE_DFP2_INDEX))
+           info->BiosConnector[i].devices = (1 << ATOM_DEVICE_DFP3_INDEX);
+       else if (info->IsIGP && (i == ATOM_DEVICE_DFP3_INDEX))
+           info->BiosConnector[i].devices = (1 << ATOM_DEVICE_DFP2_INDEX);
+       else
+           info->BiosConnector[i].devices = (1 << i);
        info->BiosConnector[i].ConnectorType = 
ci.sucConnectorInfo.sbfAccess.bfConnectorType;
        info->BiosConnector[i].DACType = 
ci.sucConnectorInfo.sbfAccess.bfAssociatedDAC;
 
@@ -1740,11 +1765,17 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable 
(ScrnInfoPtr pScrn)
 
        if (i == ATOM_DEVICE_DFP1_INDEX)
            info->BiosConnector[i].TMDSType = TMDS_INT;
-       else if (i == ATOM_DEVICE_DFP2_INDEX)
-           info->BiosConnector[i].TMDSType = TMDS_EXT;
-       else if (i == ATOM_DEVICE_DFP3_INDEX)
-           info->BiosConnector[i].TMDSType = TMDS_LVTMA;
-       else
+       else if (i == ATOM_DEVICE_DFP2_INDEX) {
+           if (info->IsIGP)
+               info->BiosConnector[i].TMDSType = TMDS_LVTMA;
+           else
+               info->BiosConnector[i].TMDSType = TMDS_EXT;
+       } else if (i == ATOM_DEVICE_DFP3_INDEX) {
+           if (info->IsIGP)
+               info->BiosConnector[i].TMDSType = TMDS_EXT;
+           else
+               info->BiosConnector[i].TMDSType = TMDS_LVTMA;
+       } else
            info->BiosConnector[i].TMDSType = TMDS_NONE;
 
        /* Always set the connector type to VGA for CRT1/CRT2. if they are

commit 03aa4cc6d6e8c715a1c1d677cc1845223505b358
Author: Roland Scheidegger <[EMAIL PROTECTED]>
Date:   Mon Feb 18 20:19:58 2008 -0500

    bring back to life planar-to-packed conversion for rs4xx
    
    Here's a patch to bring back the code for converting planar yuv to packed 
yuv,
    if a RS400 family chip is used (though I've no idea if they really all fail
    with planar yuv).
    
    fixes bug 12744

diff --git a/src/radeon_video.c b/src/radeon_video.c
index 92b4a61..0b3f6ca 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -2282,7 +2282,7 @@ RADEONCopyRGB24Data(
     }
 }
 
-#if 0
+
 #ifdef XF86DRI
 static void RADEON_420_422(
     unsigned int *d,
@@ -2398,7 +2398,7 @@ RADEONCopyMungedData(
 #endif
     }
 }
-#endif
+
 
 /* Allocates memory, either by resizing the allocation pointed to by 
mem_struct,
  * or by freeing mem_struct (if non-NULL) and allocating a new space.  The size
@@ -2889,6 +2889,7 @@ RADEONPutImage(
    int srcPitch, srcPitch2, dstPitch;
    int d2line, d3line;
    int top, left, npixels, nlines, bpp;
+   int idconv = id;
    BoxRec dstBox;
    CARD32 tmp;
    xf86CrtcPtr crtc;
@@ -2961,11 +2962,20 @@ RADEONPutImage(
        break;
    case FOURCC_YV12:
    case FOURCC_I420:
-       /* need 16bytes alignment for u,v plane, so 2 times that for width
-          but blitter needs 64bytes alignment. 128byte is a waste but dstpitch
-          for uv planes needs to be dstpitch yplane >> 1 for now. */
-       dstPitch = ((width + 127) & ~127);
-       srcPitch = (width + 3) & ~3;
+       /* it seems rs4xx chips (all of them???) either can't handle planar
+          yuv at all or would need some unknown different setup. */
+       if (info->ChipFamily != CHIP_FAMILY_RS400) {
+           /* need 16bytes alignment for u,v plane, so 2 times that for width
+              but blitter needs 64bytes alignment. 128byte is a waste but 
dstpitch
+              for uv planes needs to be dstpitch yplane >> 1 for now. */
+           dstPitch = ((width + 127) & ~127);
+           srcPitch = (width + 3) & ~3;
+       }
+       else {
+           dstPitch = width * 2;
+           srcPitch = (width + 3) & ~3;
+           idconv = FOURCC_YUY2;
+       }
        break;
    case FOURCC_UYVY:
    case FOURCC_YUY2:
@@ -2985,7 +2995,7 @@ RADEONPutImage(
        dstPitch = (dstPitch + 15) & ~15;
 
    new_size = dstPitch * height;
-   if (id == FOURCC_YV12 || id == FOURCC_I420) {
+   if (idconv == FOURCC_YV12 || id == FOURCC_I420) {
       new_size += (dstPitch >> 1) * ((height + 1) & ~1);
    }
    pPriv->video_offset = RADEONAllocateMemory(pScrn, &pPriv->video_memory,
@@ -3017,32 +3027,52 @@ RADEONPutImage(
    switch(id) {
    case FOURCC_YV12:
    case FOURCC_I420:
-/* meh. Such a mess just for someone who wants to watch half the video clipped 
*/
-       top &= ~1;
-       /* odd number of pixels? That may not work correctly */
-       srcPitch2 = ((width >> 1) + 3) & ~3;
-       /* odd number of lines? Maybe... */
-       s2offset = srcPitch * ((height + 1) & ~1);
-       s3offset = s2offset + srcPitch2 * ((height + 1) >> 1);
-       s2offset += (top >> 1) * srcPitch2 + (left >> 1);
-       s3offset += (top >> 1) * srcPitch2 + (left >> 1);
-       d2line = (height * dstPitch);
-       d3line = d2line + ((height + 1) >> 1) * (dstPitch >> 1);
-       nlines = ((yb + 0xffff) >> 16) - top;
-       d2line += (top >> 1) * (dstPitch >> 1) - (top * dstPitch);
-       d3line += (top >> 1) * (dstPitch >> 1) - (top * dstPitch);
-        if(id == FOURCC_YV12) {
-            tmp = s2offset;
-            s2offset = s3offset;
-            s3offset = tmp;
-        }
-        RADEONCopyData(pScrn, buf + (top * srcPitch) + left, dst_start + left,
+       if (id == idconv) {
+           /* meh. Such a mess just for someone who wants to watch half the 
video clipped */
+           top &= ~1;
+           /* odd number of pixels? That may not work correctly */
+           srcPitch2 = ((width >> 1) + 3) & ~3;
+           /* odd number of lines? Maybe... */
+           s2offset = srcPitch * ((height + 1) & ~1);
+           s3offset = s2offset + srcPitch2 * ((height + 1) >> 1);
+           s2offset += (top >> 1) * srcPitch2 + (left >> 1);
+           s3offset += (top >> 1) * srcPitch2 + (left >> 1);
+           d2line = (height * dstPitch);
+           d3line = d2line + ((height + 1) >> 1) * (dstPitch >> 1);
+           nlines = ((yb + 0xffff) >> 16) - top;
+           d2line += (top >> 1) * (dstPitch >> 1) - (top * dstPitch);
+           d3line += (top >> 1) * (dstPitch >> 1) - (top * dstPitch);
+           if(id == FOURCC_YV12) {
+               tmp = s2offset;
+               s2offset = s3offset;
+               s3offset = tmp;
+           }
+           RADEONCopyData(pScrn, buf + (top * srcPitch) + left, dst_start + 
left,
                srcPitch, dstPitch, nlines, npixels, 1);
-        RADEONCopyData(pScrn, buf + s2offset, dst_start + d2line + (left >> 1),
+           RADEONCopyData(pScrn, buf + s2offset, dst_start + d2line + (left >> 
1),
                srcPitch2, dstPitch >> 1, (nlines + 1) >> 1, npixels >> 1, 1);
-        RADEONCopyData(pScrn, buf + s3offset, dst_start + d3line + (left >> 1),
+           RADEONCopyData(pScrn, buf + s3offset, dst_start + d3line + (left >> 
1),
                srcPitch2, dstPitch >> 1, (nlines + 1) >> 1, npixels >> 1, 1);
-
+       }
+       else {
+           s2offset = srcPitch * height;
+           srcPitch2 = ((width >> 1) + 3) & ~3;
+           s3offset = (srcPitch2 * (height >> 1)) + s2offset;
+           top &= ~1;
+           dst_start += left << 1;
+           tmp = ((top >> 1) * srcPitch2) + (left >> 1);
+           s2offset += tmp;
+           s3offset += tmp;
+           if(id == FOURCC_I420) {
+               tmp = s2offset;
+               s2offset = s3offset;
+               s3offset = tmp;
+           }
+           nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top;
+           RADEONCopyMungedData(pScrn, buf + (top * srcPitch) + left,
+                                buf + s2offset, buf + s3offset, dst_start,
+                                srcPitch, srcPitch2, dstPitch, nlines, 
npixels);
+       }
        break;
     case FOURCC_RGBT16:
     case FOURCC_RGB16:
@@ -3080,7 +3110,7 @@ RADEONPutImage(
 
     /* FIXME: someone should look at these offsets, I don't think it makes 
sense how
               they are handled throughout the source. */
-    RADEONDisplayVideo(pScrn, crtc, pPriv, id, offset, offset + d2line, offset 
+ d3line,
+    RADEONDisplayVideo(pScrn, crtc, pPriv, idconv, offset, offset + d2line, 
offset + d3line,
                     offset, offset + d2line, offset + d3line, width, height, 
dstPitch,
                     xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h, 
METHOD_BOB);
 

commit 66b0b3f43bb714bc007169d5ba6dabe34cfc008b
Author: George Sapountzis <[EMAIL PROTECTED]>
Date:   Mon Feb 18 10:33:59 2008 +0200

    r128/radeon: probably correct fix for non pci access code

diff --git a/src/r128_probe.c b/src/r128_probe.c
index 1b07ebd..b1f427a 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -332,7 +332,7 @@ R128Probe(DriverPtr drv, int flags)
     if (flags & PROBE_DETECT)
        foundScreen = TRUE;
     else for (i = 0; i < numUsed; i++) {
-       if (r128_get_scrninfo(i))
+       if (r128_get_scrninfo(usedChips[i]))
            foundScreen = TRUE;
     }
 
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index fc621c7..4ec7485 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -180,7 +180,7 @@ RADEONProbe(DriverPtr drv, int flags)
        foundScreen = TRUE;
     } else {
        for (i = 0; i < numUsed; i++) {
-           if (radeon_get_scrninfo(i))
+           if (radeon_get_scrninfo(usedChips[i]))
                foundScreen = TRUE;
        }
     }

commit d055b9e800ae50d08cca9db75fc666ce1da9ab52
Author: Dave Airlie <[EMAIL PROTECTED]>
Date:   Sat Feb 16 09:13:43 2008 +1000

    r128/radeon: hopeful fix for non pci access code

diff --git a/src/r128_probe.c b/src/r128_probe.c
index 431efef..1b07ebd 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -332,7 +332,7 @@ R128Probe(DriverPtr drv, int flags)
     if (flags & PROBE_DETECT)
        foundScreen = TRUE;
     else for (i = 0; i < numUsed; i++) {
-       if (r128_get_scrninfo(entity_num))
+       if (r128_get_scrninfo(i))
            foundScreen = TRUE;
     }
 
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index 936d43f..fc621c7 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -180,7 +180,7 @@ RADEONProbe(DriverPtr drv, int flags)
        foundScreen = TRUE;
     } else {
        for (i = 0; i < numUsed; i++) {
-           if (radeon_get_scrninfo(entity_num))
+           if (radeon_get_scrninfo(i))
                foundScreen = TRUE;
        }
     }

commit c773bc6a314327da29e21e4ebac6fa7f3e98a0a7
Author: Dave Airlie <[EMAIL PROTECTED]>
Date:   Sat Feb 16 09:05:07 2008 +1000

    r128/radeon: fix build without pciaccess

diff --git a/src/r128_probe.c b/src/r128_probe.c
index 7895166..431efef 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -47,6 +47,10 @@
 #include "xf86PciInfo.h"
 #include "xf86Resources.h"
 
+#ifndef XSERVER_LIBPCIACCESS
+static Bool R128Probe(DriverPtr drv, int flags);
+#endif
+
 SymTabRec R128Chipsets[] = {
     { PCI_CHIP_RAGE128LE, "ATI Rage 128 Mobility M3 LE (PCI)" },
     { PCI_CHIP_RAGE128LF, "ATI Rage 128 Mobility M3 LF (AGP)" },
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index 658f909..936d43f 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -56,6 +56,10 @@
 #include "radeon_pci_device_match_gen.h"
 #endif
 
+#ifndef XSERVER_LIBPCIACCESS
+static Bool RADEONProbe(DriverPtr drv, int flags);
+#endif
+
 int gRADEONEntityIndex = -1;
 
 /* Return the options for supported chipset 'n'; NULL otherwise */

commit 690a52da5248f47a587a878d05fce9784957970b
Author: Dave Airlie <[EMAIL PROTECTED]>
Date:   Sat Feb 16 08:33:36 2008 +1000

    mach64: fix non pciaccess build

diff --git a/src/atimach64probe.c b/src/atimach64probe.c
index 087ab49..2d554e1 100644
--- a/src/atimach64probe.c
+++ b/src/atimach64probe.c
@@ -38,6 +38,10 @@
 #include "atiadjust.h"
 #include "ativalid.h"
 
+#ifndef XSERVER_LIBPCIACCESS
+static Bool Mach64Probe(DriverPtr pDriver, int flags);
+#endif
+
 SymTabRec
 Mach64Chipsets[] = {
     {ATI_CHIP_88800GXC, "ATI 88800GX-C"},

commit fc85188fd95bf78b7f965cdde3e22b644c74ff81
Author: George Sapountzis <[EMAIL PROTECTED]>
Date:   Fri Feb 15 18:36:10 2008 +0200

    ati: convert to pci probe
    
    add pciids for each subdriver, make no use of the match_data functionality.
    
    thanks to Alex Deucher for reviewing and testing.

diff --git a/src/Makefile.am b/src/Makefile.am
index 069076b..a146df3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -232,6 +232,7 @@ EXTRA_DIST = \
        radeon_chipinfo_gen.h \
        radeon_chipset_gen.h \
        radeon_pci_chipset_gen.h \
+       radeon_pci_device_match_gen.h \
        pcidb/ati_pciids.csv \
        pcidb/parse_pci_ids.pl \
        radeon_atombios.h
diff --git a/src/atimach64probe.c b/src/atimach64probe.c
index 2b701d7..087ab49 100644
--- a/src/atimach64probe.c
+++ b/src/atimach64probe.c
@@ -106,6 +106,48 @@ Mach64PciChipsets[] = {
     {-1, -1, RES_UNDEFINED}
 };
 
+#ifdef XSERVER_LIBPCIACCESS
+
+static const struct pci_id_match mach64_device_match[] = {
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GX, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64CX, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64CT, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64ET, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64VT, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GT, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64VU, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GU, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LG, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64VV, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GV, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GW, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GY, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GZ, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GB, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GD, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GI, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GP, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GQ, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LB, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LD, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LI, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LP, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LQ, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GL, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GM, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GN, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GO, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GR, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64GS, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LM, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LN, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LR, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_MACH64LS, 0 ),
+    { 0, 0, 0 }
+};
+
+#endif /* XSERVER_LIBPCIACCESS */
+
 static const OptionInfoRec *
 Mach64AvailableOptions(int chipid, int busid)
 {
@@ -127,6 +169,39 @@ Mach64Identify
             "Driver for ATI Mach64 chipsets");
 }
 
+static Bool
+mach64_get_scrninfo(int entity_num)
+{
+    ScrnInfoPtr pScrn;
+
+    pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, Mach64PciChipsets,
+                                0, 0, 0, 0, NULL);
+
+    if (!pScrn)
+        return FALSE;
+
+    pScrn->driverVersion = MACH64_VERSION_CURRENT;
+    pScrn->driverName    = MACH64_DRIVER_NAME;
+    pScrn->name          = MACH64_NAME;
+#ifdef XSERVER_LIBPCIACCESS
+    pScrn->Probe         = NULL;
+#else
+    pScrn->Probe         = Mach64Probe;
+#endif
+    pScrn->PreInit       = ATIPreInit;
+    pScrn->ScreenInit    = ATIScreenInit;
+    pScrn->SwitchMode    = ATISwitchMode;
+    pScrn->AdjustFrame   = ATIAdjustFrame;
+    pScrn->EnterVT       = ATIEnterVT;
+    pScrn->LeaveVT       = ATILeaveVT;
+    pScrn->FreeScreen    = ATIFreeScreen;
+    pScrn->ValidMode     = ATIValidMode;
+
+    return TRUE;
+}
+
+#ifndef XSERVER_LIBPCIACCESS
+
 /*
  * Mach64Probe --
  *
@@ -141,11 +216,10 @@ Mach64Probe(DriverPtr pDriver, int flags)
     int     numDevSections;
     int     numUsed;
     Bool    ProbeSuccess = FALSE;
+    int     i;
 
-#ifndef XSERVER_LIBPCIACCESS
     if (xf86GetPciVideoInfo() == NULL)
         return FALSE;
-#endif
 
     numDevSections = xf86MatchDevice(MACH64_DRIVER_NAME, &devSections);
 
@@ -164,31 +238,9 @@ Mach64Probe(DriverPtr pDriver, int flags)
     if (flags & PROBE_DETECT) {
         ProbeSuccess = TRUE;
     } else {
-        int  i;
-
         for (i = 0; i < numUsed; i++) {
-            ScrnInfoPtr pScrn;
-
-            pScrn = xf86ConfigPciEntity(NULL, 0, usedChips[i], 
Mach64PciChipsets,
-                                        0, 0, 0, 0, NULL);
-
-            if (!pScrn)
-                continue;
-
-            pScrn->driverVersion = MACH64_VERSION_CURRENT;
-            pScrn->driverName    = MACH64_DRIVER_NAME;
-            pScrn->name          = MACH64_NAME;
-            pScrn->Probe         = Mach64Probe;
-            pScrn->PreInit       = ATIPreInit;
-            pScrn->ScreenInit    = ATIScreenInit;
-            pScrn->SwitchMode    = ATISwitchMode;
-            pScrn->AdjustFrame   = ATIAdjustFrame;
-            pScrn->EnterVT       = ATIEnterVT;
-            pScrn->LeaveVT       = ATILeaveVT;
-            pScrn->FreeScreen    = ATIFreeScreen;
-            pScrn->ValidMode     = ATIValidMode;
-
-            ProbeSuccess = TRUE;
+            if (mach64_get_scrninfo(usedChips[i]))
+                ProbeSuccess = TRUE;
         }
     }
 
@@ -197,13 +249,37 @@ Mach64Probe(DriverPtr pDriver, int flags)
     return ProbeSuccess;
 }
 
+#else /* XSERVER_LIBPCIACCESS */
+
+static Bool
+mach64_pci_probe(
+    DriverPtr          pDriver,
+    int                entity_num,
+    struct pci_device *device,
+    intptr_t           match_data
+)
+{
+    return mach64_get_scrninfo(entity_num);
+}
+
+#endif /* XSERVER_LIBPCIACCESS */
+
 _X_EXPORT DriverRec MACH64 =
 {
     MACH64_VERSION_CURRENT,
     MACH64_DRIVER_NAME,
     Mach64Identify,
+#ifdef XSERVER_LIBPCIACCESS
+    NULL,
+#else
     Mach64Probe,
+#endif
     Mach64AvailableOptions,
     NULL,
-    0
+    0,
+    NULL,
+#ifdef XSERVER_LIBPCIACCESS
+    mach64_device_match,
+    mach64_pci_probe
+#endif
 };
diff --git a/src/atimisc.c b/src/atimisc.c
index 0bcbff5..ebfde54 100644
--- a/src/atimisc.c
+++ b/src/atimisc.c
@@ -63,7 +63,7 @@ ATISetup
     if (!Inited)
     {
         Inited = TRUE;
-        xf86AddDriver(&MACH64, Module, 0);
+        xf86AddDriver(&MACH64, Module, HaveDriverFuncs);
     }
 
     return (pointer)TRUE;
diff --git a/src/atipcirename.h b/src/atipcirename.h
index 5aa6b80..de8f0a3 100644
--- a/src/atipcirename.h
+++ b/src/atipcirename.h
@@ -117,6 +117,9 @@ typedef struct pci_device *pciVideoPtr;
 #define PCI_WRITE_LONG(_pcidev, _value, _offset) \
     pci_device_cfg_write_u32((_pcidev), (_value), (_offset))
 
+#define ATI_DEVICE_MATCH(d, i) \
+    { PCI_VENDOR_ATI, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
+
 #endif /* XSERVER_LIBPCIACCESS */
 
 #endif /* ATIPCIRENAME_H */
diff --git a/src/pcidb/parse_pci_ids.pl b/src/pcidb/parse_pci_ids.pl
index e6eac76..a3a8af8 100755
--- a/src/pcidb/parse_pci_ids.pl
+++ b/src/pcidb/parse_pci_ids.pl
@@ -12,6 +12,7 @@ my $file = $ARGV[0];
 
 my $atioutfile = 'ati_pciids_gen.h';
 my $radeonpcichipsetfile = 'radeon_pci_chipset_gen.h';
+my $radeonpcidevicematchfile = 'radeon_pci_device_match_gen.h';
 my $radeonchipsetfile = 'radeon_chipset_gen.h';
 my $radeonchipinfofile  = 'radeon_chipinfo_gen.h';
 
@@ -21,6 +22,7 @@ open (CSV, "<", $file) or die $!;
 
 open (ATIOUT, ">", $atioutfile) or die;
 open (PCICHIPSET, ">", $radeonpcichipsetfile) or die;
+open (PCIDEVICEMATCH, ">", $radeonpcidevicematchfile) or die;
 open (RADEONCHIPSET, ">", $radeonchipsetfile) or die;
 open (RADEONCHIPINFO, ">", $radeonchipinfofile) or die;
 
@@ -28,6 +30,8 @@ print RADEONCHIPSET "/* This file is autogenerated please do 
not edit */\n";
 print RADEONCHIPSET "static SymTabRec RADEONChipsets[] = {\n";
 print PCICHIPSET "/* This file is autogenerated please do not edit */\n";
 print PCICHIPSET "PciChipsets RADEONPciChipsets[] = {\n";
+print PCIDEVICEMATCH "/* This file is autogenerated please do not edit */\n";
+print PCIDEVICEMATCH "static const struct pci_id_match radeon_device_match[] = 
{\n";
 print RADEONCHIPINFO "/* This file is autogenerated please do not edit */\n";
 print RADEONCHIPINFO "RADEONCardInfo RADEONCards[] = {\n";
 while (<CSV>) {
@@ -41,6 +45,8 @@ while (<CSV>) {
       if (($columns[2] ne "R128") && ($columns[2] ne "MACH64") && ($columns[2] 
ne "MACH32")) {
        print PCICHIPSET " { PCI_CHIP_$columns[1], PCI_CHIP_$columns[1], 
RES_SHARED_VGA },\n";
        
+       print PCIDEVICEMATCH " ATI_DEVICE_MATCH( PCI_CHIP_$columns[1], 0 ),\n";
+
        print RADEONCHIPSET "  { PCI_CHIP_$columns[1], \"$columns[8]\" },\n";
 
        print RADEONCHIPINFO " { $columns[0], CHIP_FAMILY_$columns[2], ";
@@ -87,8 +93,10 @@ while (<CSV>) {
 print RADEONCHIPINFO "};\n";
 print RADEONCHIPSET "  { -1,                 NULL }\n};\n";
 print PCICHIPSET " { -1,                 -1,                 RES_UNDEFINED 
}\n};\n";
+print PCIDEVICEMATCH " { 0, 0, 0 }\n};\n";
 close CSV;
 close ATIOUT;
 close PCICHIPSET;
+close PCIDEVICEMATCH;
 close RADEONCHIPSET;
 close RADEONCHIPINFO;
diff --git a/src/r128_misc.c b/src/r128_misc.c
index 5eb6fac..2dc6040 100644
--- a/src/r128_misc.c
+++ b/src/r128_misc.c
@@ -64,7 +64,7 @@ R128Setup
     if (!Inited)
     {
         Inited = TRUE;
-        xf86AddDriver(&R128, Module, 0);
+        xf86AddDriver(&R128, Module, HaveDriverFuncs);
     }
 
     return (pointer)TRUE;
diff --git a/src/r128_probe.c b/src/r128_probe.c
index 8fc65cb..7895166 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -41,6 +41,7 @@
 
 #include "r128_probe.h"
 #include "r128_version.h"
+#include "atipcirename.h"
 
 #include "xf86.h"
 #include "xf86PciInfo.h"
@@ -148,6 +149,61 @@ static PciChipsets R128PciChipsets[] = {
     { -1,                 -1,                 RES_UNDEFINED }
 };
 
+#ifdef XSERVER_LIBPCIACCESS
+
+static const struct pci_id_match r128_device_match[] = {
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128LE, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128LF, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128MF, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128ML, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PA, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PB, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PC, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PD, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PE, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PF, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PG, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PH, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PI, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PJ, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PK, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PL, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PM, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PN, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PO, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PP, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PQ, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PR, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PS, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PT, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PU, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PV, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PW, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128PX, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128RE, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128RF, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128RG, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128RK, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128RL, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SE, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SF, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SG, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SH, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SK, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SL, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SM, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128SN, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128TF, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128TL, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128TR, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128TS, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128TT, 0 ),
+    ATI_DEVICE_MATCH( PCI_CHIP_RAGE128TU, 0 ),
+    { 0, 0, 0 }
+};
+
+#endif /* XSERVER_LIBPCIACCESS */
+
 int gR128EntityIndex = -1;
 
 /* Return the options for supported chipset 'n'; NULL otherwise */
@@ -166,6 +222,81 @@ R128Identify(int flags)
                      R128Chipsets);
 }
 
+static Bool
+r128_get_scrninfo(int entity_num)
+{
+    ScrnInfoPtr   pScrn = NULL;
+    EntityInfoPtr pEnt;
+
+    pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, R128PciChipsets,
+                                NULL,
+                                NULL, NULL, NULL, NULL);
+
+    if (!pScrn)
+        return FALSE;
+
+    pScrn->driverVersion = R128_VERSION_CURRENT;
+    pScrn->driverName    = R128_DRIVER_NAME;
+    pScrn->name          = R128_NAME;
+#ifdef XSERVER_LIBPCIACCESS
+    pScrn->Probe         = NULL;
+#else
+    pScrn->Probe         = R128Probe;
+#endif
+    pScrn->PreInit       = R128PreInit;
+    pScrn->ScreenInit    = R128ScreenInit;
+    pScrn->SwitchMode    = R128SwitchMode;
+    pScrn->AdjustFrame   = R128AdjustFrame;
+    pScrn->EnterVT       = R128EnterVT;
+    pScrn->LeaveVT       = R128LeaveVT;
+    pScrn->FreeScreen    = R128FreeScreen;
+    pScrn->ValidMode     = R128ValidMode;
+
+    pEnt = xf86GetEntityInfo(entity_num);
+
+    /* mobility cards support Dual-Head, mark the entity as sharable*/
+    if (pEnt->chipset == PCI_CHIP_RAGE128LE ||
+        pEnt->chipset == PCI_CHIP_RAGE128LF ||
+        pEnt->chipset == PCI_CHIP_RAGE128MF ||
+        pEnt->chipset == PCI_CHIP_RAGE128ML)
+    {
+        static int instance = 0;
+        DevUnion* pPriv;
+
+        xf86SetEntitySharable(entity_num);
+
+        xf86SetEntityInstanceForScreen(pScrn,
+                                       pScrn->entityList[0],
+                                       instance);
+
+        if (gR128EntityIndex < 0)
+        {
+            gR128EntityIndex = xf86AllocateEntityPrivateIndex();
+
+            pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
+                                         gR128EntityIndex);
+
+            if (!pPriv->ptr)
+            {
+                R128EntPtr pR128Ent;
+                pPriv->ptr = xnfcalloc(sizeof(R128EntRec), 1);
+                pR128Ent = pPriv->ptr;
+                pR128Ent->IsDRIEnabled = FALSE;
+                pR128Ent->BypassSecondary = FALSE;
+                pR128Ent->HasSecondary = FALSE;
+                pR128Ent->IsSecondaryRestored = FALSE;
+            }
+        }
+        instance++;
+    }
+
+    xfree(pEnt);
+
+    return TRUE;
+}
+
+#ifndef XSERVER_LIBPCIACCESS
+
 /* Return TRUE if chipset is present; FALSE otherwise. */
 static Bool
 R128Probe(DriverPtr drv, int flags)
@@ -177,9 +308,7 @@ R128Probe(DriverPtr drv, int flags)
     Bool          foundScreen = FALSE;
     int           i;
 
-#ifndef XSERVER_LIBPCIACCESS
     if (!xf86GetPciVideoInfo()) return FALSE;
-#endif
 
     numDevSections = xf86MatchDevice(R128_NAME, &devSections);
 
@@ -199,64 +328,8 @@ R128Probe(DriverPtr drv, int flags)
     if (flags & PROBE_DETECT)
        foundScreen = TRUE;
     else for (i = 0; i < numUsed; i++) {
-        ScrnInfoPtr pScrn;
-        EntityInfoPtr pEnt;
- 
-        pScrn    = NULL;
-        if((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
-             R128PciChipsets, NULL, NULL, NULL, NULL, NULL)))
-       {
-           pScrn->driverVersion = R128_VERSION_CURRENT;
-           pScrn->driverName    = R128_DRIVER_NAME;
-           pScrn->name          = R128_NAME;
-           pScrn->Probe         = R128Probe;
-           pScrn->PreInit       = R128PreInit;
-           pScrn->ScreenInit    = R128ScreenInit;
-           pScrn->SwitchMode    = R128SwitchMode;
-           pScrn->AdjustFrame   = R128AdjustFrame;
-           pScrn->EnterVT       = R128EnterVT;
-           pScrn->LeaveVT       = R128LeaveVT;
-           pScrn->FreeScreen    = R128FreeScreen;
-           pScrn->ValidMode     = R128ValidMode;
-
-           foundScreen          = TRUE;
-
-        pEnt = xf86GetEntityInfo(usedChips[i]);
-
-        /* mobility cards support Dual-Head, mark the entity as sharable*/
-        if(pEnt->chipset == PCI_CHIP_RAGE128LE ||
-           pEnt->chipset == PCI_CHIP_RAGE128LF ||
-           pEnt->chipset == PCI_CHIP_RAGE128MF ||
-           pEnt->chipset == PCI_CHIP_RAGE128ML)
-        {
-            static int instance = 0;
-            DevUnion* pPriv;
-
-            xf86SetEntitySharable(usedChips[i]);
-            xf86SetEntityInstanceForScreen(pScrn,
-                pScrn->entityList[0], instance);
-
-            if(gR128EntityIndex < 0)
-            {
-                gR128EntityIndex = xf86AllocateEntityPrivateIndex();
-                pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
-                        gR128EntityIndex);
-
-                if (!pPriv->ptr)
-                {


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to