xf86-video-ati: Branch 'master' - 5 commits

George Sapountzis gsap7 at kemper.freedesktop.org
Wed Jan 16 06:20:09 PST 2008


 man/ati.man            |    2 
 src/Makefile.am        |    8 +--
 src/ati.c              |  102 ++++++++++++++++++++++++++++++++++++-------------
 src/ati.h              |    2 
 src/atibus.c           |    1 
 src/atichip.c          |    4 -
 src/atidri.c           |    8 +--
 src/atimach64probe.c   |   58 ++++++++++++++++++++++-----
 src/atimach64probe.h   |    6 --
 src/atimach64version.h |   59 ++++++++++++++++++++++++++++
 src/atimisc.c          |   44 +++------------------
 src/atiprobe.c         |   24 +++++------
 src/r128_probe.c       |   17 ++++++--
 src/r128_probe.h       |    4 -
 src/radeon_probe.c     |   17 ++++++--
 src/radeon_probe.h     |    4 -
 16 files changed, 241 insertions(+), 119 deletions(-)

New commits:
commit 2ba3562d2af911fdd90881049599e239d27260bc
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sat Jan 12 17:11:59 2008 +0200

    ati wrapper: xf86PciInfo.h is enough

diff --git a/src/ati.h b/src/ati.h
index fbb8521..0a32acf 100644
--- a/src/ati.h
+++ b/src/ati.h
@@ -25,7 +25,7 @@
 
 #include <unistd.h>
 #include "xf86Pci.h"
-#include "atipciids.h"
+#include "xf86PciInfo.h"
 
 #include "xf86.h"
 
commit c2caeb11a97dad5379d70881c5c0fd834a8c3d54
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sat Jan 12 16:18:34 2008 +0200

    ati wrapper: add DriverRec's and use them

diff --git a/src/ati.c b/src/ati.c
index 5a4eb01..caee443 100644
--- a/src/ati.c
+++ b/src/ati.c
@@ -65,9 +65,13 @@
 #include "ati.h"
 #include "ativersion.h"
 
-#include "atimach64probe.h"
-#include "radeon_probe.h"
-#include "r128_probe.h"
+/* names duplicated from version headers */
+#define MACH64_NAME         "MACH64"
+#define MACH64_DRIVER_NAME  "mach64"
+#define R128_NAME           "R128"
+#define R128_DRIVER_NAME    "r128"
+#define RADEON_NAME         "RADEON"
+#define RADEON_DRIVER_NAME  "radeon"
 
 enum
 {
@@ -193,61 +197,70 @@ ATIProbe
     /* Call Radeon driver probe */
     if (DoRadeon)
     {
-        pointer radeon = xf86LoadDrvSubModule(pDriver, "radeon");
+        DriverRec *radeon;
+
+        if (!LoaderSymbol(RADEON_NAME))
+            xf86LoadDrvSubModule(pDriver, RADEON_DRIVER_NAME);
+
+        radeon = (DriverRec*)LoaderSymbol(RADEON_NAME);
 
         if (!radeon)
         {
             xf86Msg(X_ERROR,
-                ATI_NAME ":  Failed to load \"radeon\" module.\n");
+                ATI_NAME ":  Failed to find \"radeon\" driver symbol.\n");
             return FALSE;
         }
 
-        RADEONIdentify(flags);
+        radeon->Identify(flags);
 
-        if (RADEONProbe(pDriver, flags))
+        if (radeon->Probe(pDriver, flags))
             return TRUE;
-
-        xf86UnloadSubModule(radeon);
     }
 
     /* Call Rage 128 driver probe */
     if (DoRage128)
     {
-        pointer r128 = xf86LoadDrvSubModule(pDriver, "r128");
+        DriverRec *r128;
+
+        if (!LoaderSymbol(R128_NAME))
+            xf86LoadDrvSubModule(pDriver, R128_DRIVER_NAME);
+
+        r128 = (DriverRec*)LoaderSymbol(R128_NAME);
 
         if (!r128)
         {
             xf86Msg(X_ERROR,
-                ATI_NAME ":  Failed to load \"r128\" module.\n");
+                ATI_NAME ":  Failed to find \"r128\" driver symbol.\n");
             return FALSE;
         }
 
-        R128Identify(flags);
+        r128->Identify(flags);
 
-        if (R128Probe(pDriver, flags))
+        if (r128->Probe(pDriver, flags))
             return TRUE;
-
-        xf86UnloadSubModule(r128);
     }
 
     /* Call Mach64 driver probe */
     if (DoMach64)
     {
-        pointer mach64 = xf86LoadDrvSubModule(pDriver, "mach64");
+        DriverRec *mach64;
+
+        if (!LoaderSymbol(MACH64_NAME))
+            xf86LoadDrvSubModule(pDriver, MACH64_DRIVER_NAME);
+
+        mach64 = (DriverRec*)LoaderSymbol(MACH64_NAME);
 
         if (!mach64)
         {
             xf86Msg(X_ERROR,
-                ATI_NAME ":  Failed to load \"mach64\" module.\n");
+                ATI_NAME ":  Failed to find \"mach64\" driver symbol.\n");
             return FALSE;
         }
 
-        Mach64Identify(flags);
+        mach64->Identify(flags);
 
-        if (Mach64Probe(pDriver, flags))
+        if (mach64->Probe(pDriver, flags))
             return TRUE;
-
-        xf86UnloadSubModule(mach64);
     }
 
     return FALSE;
@@ -272,11 +285,46 @@ ATIAvailableOptions
 
     Chip = ATIChipID(ChipType);
     if (Chip == ATI_CHIP_FAMILY_Mach64)
-        return Mach64AvailableOptions(ChipId, BusId);
-    else if (Chip == ATI_CHIP_FAMILY_Rage128)
-        return R128AvailableOptions(ChipId, BusId);
-    else if (Chip == ATI_CHIP_FAMILY_Radeon)
-        return RADEONAvailableOptions(ChipId, BusId);
+    {
+        DriverRec *mach64 = (DriverRec*)LoaderSymbol(MACH64_NAME);
+
+        if (!mach64)
+        {
+            xf86Msg(X_ERROR,
+                ATI_NAME ":  Failed to find \"mach64\" driver symbol.\n");
+            return NULL;
+        }
+
+        return mach64->AvailableOptions(ChipId, BusId);
+    }
+
+    if (Chip == ATI_CHIP_FAMILY_Rage128)
+    {
+        DriverRec *r128 = (DriverRec*)LoaderSymbol(R128_NAME);
+
+        if (!r128)
+        {
+            xf86Msg(X_ERROR,
+                ATI_NAME ":  Failed to find \"r128\" driver symbol.\n");
+            return NULL;
+        }
+
+        return r128->AvailableOptions(ChipId, BusId);
+    }
+
+    if (Chip == ATI_CHIP_FAMILY_Radeon)
+    {
+        DriverRec *radeon = (DriverRec*)LoaderSymbol(RADEON_NAME);
+
+        if (!radeon)
+        {
+            xf86Msg(X_ERROR,
+                ATI_NAME ":  Failed to find \"radeon\" driver symbol.\n");
+            return NULL;
+        }
+
+        return radeon->AvailableOptions(ChipId, BusId);
+    }
 
     return NULL;
 }
diff --git a/src/atimach64probe.c b/src/atimach64probe.c
index 5227775..ffab153 100644
--- a/src/atimach64probe.c
+++ b/src/atimach64probe.c
@@ -107,7 +107,7 @@ Mach64PciChipsets[] = {
     {-1, -1, RES_UNDEFINED}
 };
 
-_X_EXPORT const OptionInfoRec *
+static const OptionInfoRec *
 Mach64AvailableOptions(int chipid, int busid)
 {
     /*
@@ -122,7 +122,7 @@ Mach64AvailableOptions(int chipid, int busid)
  *
  * Print the driver's list of chipset names.
  */
-_X_EXPORT void
+static void
 Mach64Identify
 (
     int flags
@@ -138,7 +138,7 @@ Mach64Identify
  * This function is called once, at the start of the first server generation to
  * do a minimal probe for supported hardware.
  */
-_X_EXPORT Bool
+static Bool
 Mach64Probe(DriverPtr pDriver, int flags)
 {
     GDevPtr *devSections, *ATIGDevs, *Mach64GDevs;
@@ -221,3 +221,14 @@ Mach64Probe(DriverPtr pDriver, int flags)
 
     return ProbeSuccess;
 }
+
+_X_EXPORT DriverRec MACH64 =
+{
+    MACH64_VERSION_CURRENT,
+    MACH64_DRIVER_NAME,
+    Mach64Identify,
+    Mach64Probe,
+    Mach64AvailableOptions,
+    NULL,
+    0
+};
diff --git a/src/atimach64probe.h b/src/atimach64probe.h
index 65ced98..9d50b63 100644
--- a/src/atimach64probe.h
+++ b/src/atimach64probe.h
@@ -25,10 +25,6 @@
 
 #include "xf86str.h"
 
-extern SymTabRec             Mach64Chipsets[];
-
-extern const OptionInfoRec * Mach64AvailableOptions(int, int);
-extern void                  Mach64Identify(int);
-extern Bool                  Mach64Probe(DriverPtr, int);
+extern SymTabRec Mach64Chipsets[];
 
 #endif /* ___ATIMACH64PROBE_H___ */
diff --git a/src/r128_probe.c b/src/r128_probe.c
index 0be21e8..5dd5cc9 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -106,7 +106,7 @@ PciChipsets R128PciChipsets[] = {
 int gR128EntityIndex = -1;
 
 /* Return the options for supported chipset 'n'; NULL otherwise */
-_X_EXPORT const OptionInfoRec *
+static const OptionInfoRec *
 R128AvailableOptions(int chipid, int busid)
 {
     int i;
@@ -125,7 +125,7 @@ R128AvailableOptions(int chipid, int busid)
 }
 
 /* Return the string name for supported chipset 'n'; NULL otherwise. */
-_X_EXPORT void
+static void
 R128Identify(int flags)
 {
     xf86PrintChipsets(R128_NAME,
@@ -134,7 +134,7 @@ R128Identify(int flags)
 }
 
 /* Return TRUE if chipset is present; FALSE otherwise. */
-_X_EXPORT Bool
+static Bool
 R128Probe(DriverPtr drv, int flags)
 {
     int           numUsed;
@@ -253,3 +253,14 @@ R128Probe(DriverPtr drv, int flags)
 
     return foundScreen;
 }
+
+_X_EXPORT DriverRec R128 =
+{
+    R128_VERSION_CURRENT,
+    R128_DRIVER_NAME,
+    R128Identify,
+    R128Probe,
+    R128AvailableOptions,
+    NULL,
+    0
+};
diff --git a/src/r128_probe.h b/src/r128_probe.h
index 82d0fbe..2885604 100644
--- a/src/r128_probe.h
+++ b/src/r128_probe.h
@@ -54,10 +54,6 @@ typedef struct
 } R128EntRec, *R128EntPtr;
 
 /* r128_probe.c */
-extern const OptionInfoRec * R128AvailableOptions(int, int);
-extern void                  R128Identify(int);
-extern Bool                  R128Probe(DriverPtr, int);
-
 extern PciChipsets           R128PciChipsets[];
 
 /* r128_driver.c */
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index e0a77e6..0cf54b6 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -58,7 +58,7 @@
 int gRADEONEntityIndex = -1;
 
 /* Return the options for supported chipset 'n'; NULL otherwise */
-_X_EXPORT const OptionInfoRec *
+static const OptionInfoRec *
 RADEONAvailableOptions(int chipid, int busid)
 {
     int  i;
@@ -77,7 +77,7 @@ RADEONAvailableOptions(int chipid, int busid)
 }
 
 /* Return the string name for supported chipset 'n'; NULL otherwise. */
-_X_EXPORT void
+static void
 RADEONIdentify(int flags)
 {
     xf86PrintChipsets(RADEON_NAME,
@@ -86,7 +86,7 @@ RADEONIdentify(int flags)
 }
 
 /* Return TRUE if chipset is present; FALSE otherwise. */
-_X_EXPORT Bool
+static Bool
 RADEONProbe(DriverPtr drv, int flags)
 {
     int      numUsed;
@@ -207,3 +207,14 @@ RADEONProbe(DriverPtr drv, int flags)
 
     return foundScreen;
 }
+
+_X_EXPORT DriverRec RADEON =
+{
+    RADEON_VERSION_CURRENT,
+    RADEON_DRIVER_NAME,
+    RADEONIdentify,
+    RADEONProbe,
+    RADEONAvailableOptions,
+    NULL,
+    0
+};
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 5828133..37cd6e6 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -543,10 +543,6 @@ typedef struct
 } RADEONEntRec, *RADEONEntPtr;
 
 /* radeon_probe.c */
-extern const OptionInfoRec *RADEONAvailableOptions(int, int);
-extern void                 RADEONIdentify(int);
-extern Bool                 RADEONProbe(DriverPtr, int);
-
 extern PciChipsets          RADEONPciChipsets[];
 
 /* radeon_driver.c */
commit 19e1b180fec6f83a474e125465bc60111c0f43e0
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sat Jan 12 16:18:07 2008 +0200

    mach64: load for both "ati" and "mach64" as driver names
    
    similar to r128/radeon

diff --git a/src/atimach64probe.c b/src/atimach64probe.c
index 5ea2ccc..5227775 100644
--- a/src/atimach64probe.c
+++ b/src/atimach64probe.c
@@ -141,9 +141,9 @@ Mach64Identify
 _X_EXPORT Bool
 Mach64Probe(DriverPtr pDriver, int flags)
 {
-    GDevPtr *devSections;
+    GDevPtr *devSections, *ATIGDevs, *Mach64GDevs;
     int     *usedChips;
-    int     numDevSections;
+    int     numDevSections, nATIGDev, nMach64GDev;
     int     numUsed;
     Bool    ProbeSuccess = FALSE;
 
@@ -152,9 +152,31 @@ Mach64Probe(DriverPtr pDriver, int flags)
         return FALSE;
 #endif
 
-    if ((numDevSections = xf86MatchDevice(ATI_DRIVER_NAME, &devSections)) <= 0)
+    /* Collect unclaimed device sections for both driver names */
+    nATIGDev = xf86MatchDevice(ATI_DRIVER_NAME, &ATIGDevs);
+    nMach64GDev = xf86MatchDevice(MACH64_DRIVER_NAME, &Mach64GDevs);
+
+    if ((numDevSections = nATIGDev + nMach64GDev) <= 0)
         return FALSE;
 
+    if (ATIGDevs == NULL) {
+        devSections = Mach64GDevs;
+        numDevSections = nMach64GDev;
+    } else if (Mach64GDevs == NULL) {
+        devSections = ATIGDevs;
+        numDevSections = nATIGDev;
+    } else {
+        /* Combine into one list */
+        devSections = xnfalloc((numDevSections + 1) * sizeof(GDevPtr));
+        (void)memcpy(devSections,
+                     ATIGDevs, nATIGDev * sizeof(GDevPtr));
+        (void)memcpy(devSections + nATIGDev,
+                     Mach64GDevs, nMach64GDev * sizeof(GDevPtr));
+        devSections[numDevSections] = NULL;
+        xfree(ATIGDevs);
+        xfree(Mach64GDevs);
+    }
+
     numUsed = xf86MatchPciInstances(MACH64_NAME, PCI_VENDOR_ATI,
                                     Mach64Chipsets, Mach64PciChipsets,
                                     devSections, numDevSections,
commit 92f54400d5450b29b3a76d5ecc927cf0d73e156e
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sat Jan 12 16:17:47 2008 +0200

    mach64: add version (need not match with ati)
    
    similar to r128/radeon

diff --git a/src/atibus.c b/src/atibus.c
index 32f02b6..69a3089 100644
--- a/src/atibus.c
+++ b/src/atibus.c
@@ -31,7 +31,6 @@
 #include "atichip.h"
 #include "atimach64io.h"
 #include "atistruct.h"
-#include "ativersion.h"
 
 /*
  * Definitions related to an adapter's system bus interface.
diff --git a/src/atichip.c b/src/atichip.c
index 5f8a221..aac00e6 100644
--- a/src/atichip.c
+++ b/src/atichip.c
@@ -28,7 +28,7 @@
 #include "atibus.h"
 #include "atichip.h"
 #include "atimach64io.h"
-#include "ativersion.h"
+#include "atimach64version.h"
 
 const char *ATIFoundryNames[] =
     { "SGS", "NEC", "KCS", "UMC", "TSMC", "5", "6", "UMC" };
@@ -114,7 +114,7 @@ ATIMach64ChipID
                     pATI->Chip = ATI_CHIP_264GT;
                 else
                     xf86Msg(X_WARNING,
-                            ATI_NAME ":  Mach64 chip type probe discrepancy"
+                            MACH64_NAME ":  Mach64 chip type probe discrepancy"
                             " detected:  PCI=0x%04X;  CHIP_ID=0x%04X.\n",
                             ExpectedChipType, pATI->ChipType);
             }
diff --git a/src/atidri.c b/src/atidri.c
index 0da1bc5..15d0014 100644
--- a/src/atidri.c
+++ b/src/atidri.c
@@ -41,9 +41,9 @@
 #include "atidri.h"
 #include "atiregs.h"
 #include "atistruct.h"
-#include "ativersion.h"
 
 #include "atimach64io.h"
+#include "atimach64version.h"
 #include "mach64_dri.h"
 #include "mach64_common.h"
 #include "mach64_sarea.h"
@@ -1244,9 +1244,9 @@ Bool ATIDRIScreenInit( ScreenPtr pScreen )
 	       PCI_DEV_DEV(pATI->PCIInfo),
 	       PCI_DEV_FUNC(pATI->PCIInfo) );
    }
-   pDRIInfo->ddxDriverMajorVersion = ATI_VERSION_MAJOR;
-   pDRIInfo->ddxDriverMinorVersion = ATI_VERSION_MINOR;
-   pDRIInfo->ddxDriverPatchVersion = ATI_VERSION_PATCH;
+   pDRIInfo->ddxDriverMajorVersion = MACH64_VERSION_MAJOR;
+   pDRIInfo->ddxDriverMinorVersion = MACH64_VERSION_MINOR;
+   pDRIInfo->ddxDriverPatchVersion = MACH64_VERSION_PATCH;
    pDRIInfo->frameBufferPhysicalAddress = (void *)pATI->LinearBase;
    pDRIInfo->frameBufferSize = pATI->LinearSize;
    pDRIInfo->frameBufferStride = (pScreenInfo->displayWidth *
diff --git a/src/atimach64probe.c b/src/atimach64probe.c
index b365b09..5ea2ccc 100644
--- a/src/atimach64probe.c
+++ b/src/atimach64probe.c
@@ -28,6 +28,7 @@
 #include "atichip.h"
 #include "atimach64io.h"
 #include "atimach64probe.h"
+#include "atimach64version.h"
 #include "atioption.h"
 #include "ativersion.h"
 
@@ -127,7 +128,7 @@ Mach64Identify
     int flags
 )
 {
-    xf86Msg(X_INFO, "%s: %s\n", ATI_NAME,
+    xf86Msg(X_INFO, "%s: %s\n", MACH64_NAME,
             "Driver for ATI Mach64 chipsets");
 }
 
@@ -154,7 +155,7 @@ Mach64Probe(DriverPtr pDriver, int flags)
     if ((numDevSections = xf86MatchDevice(ATI_DRIVER_NAME, &devSections)) <= 0)
         return FALSE;
 
-    numUsed = xf86MatchPciInstances(ATI_DRIVER_NAME, PCI_VENDOR_ATI,
+    numUsed = xf86MatchPciInstances(MACH64_NAME, PCI_VENDOR_ATI,
                                     Mach64Chipsets, Mach64PciChipsets,
                                     devSections, numDevSections,
                                     pDriver, &usedChips);
@@ -177,9 +178,9 @@ Mach64Probe(DriverPtr pDriver, int flags)
             if (!pScrn)
                 continue;
 
-            pScrn->driverVersion = ATI_VERSION_CURRENT;
-            pScrn->driverName    = ATI_DRIVER_NAME;
-            pScrn->name          = ATI_NAME;
+            pScrn->driverVersion = MACH64_VERSION_CURRENT;
+            pScrn->driverName    = MACH64_DRIVER_NAME;
+            pScrn->name          = MACH64_NAME;
             pScrn->Probe         = Mach64Probe;
             pScrn->PreInit       = ATIPreInit;
             pScrn->ScreenInit    = ATIScreenInit;
diff --git a/src/atimach64version.h b/src/atimach64version.h
new file mode 100644
index 0000000..c1848bd
--- /dev/null
+++ b/src/atimach64version.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi at xfree86.org
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of Marc Aurele La France not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Marc Aurele La France makes no representations
+ * about the suitability of this software for any purpose.  It is provided
+ * "as-is" without express or implied warranty.
+ *
+ * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
+ * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _MACH64_VERSION_H_
+#define _MACH64_VERSION_H_ 1
+
+#undef  MACH64_NAME
+#undef  MACH64_DRIVER_NAME
+#undef  MACH64_VERSION_MAJOR
+#undef  MACH64_VERSION_MINOR
+#undef  MACH64_VERSION_PATCH
+#undef  MACH64_VERSION_CURRENT
+#undef  MACH64_VERSION_EVALUATE
+#undef  MACH64_VERSION_STRINGIFY
+#undef  MACH64_VERSION_NAME
+
+#define MACH64_NAME          "MACH64"
+#define MACH64_DRIVER_NAME   "mach64"
+
+#define MACH64_VERSION_MAJOR 6
+#define MACH64_VERSION_MINOR 7
+#define MACH64_VERSION_PATCH 0
+
+#ifndef MACH64_VERSION_EXTRA
+#define MACH64_VERSION_EXTRA ""
+#endif
+
+#define MACH64_VERSION_CURRENT \
+    ((MACH64_VERSION_MAJOR << 20) | \
+     (MACH64_VERSION_MINOR << 10) | \
+     (MACH64_VERSION_PATCH))
+
+#define MACH64_VERSION_EVALUATE(__x) #__x
+#define MACH64_VERSION_STRINGIFY(_x) MACH64_VERSION_EVALUATE(_x)
+#define MACH64_VERSION_NAME                                             \
+    MACH64_VERSION_STRINGIFY(MACH64_VERSION_MAJOR) "."                  \
+    MACH64_VERSION_STRINGIFY(MACH64_VERSION_MINOR) "."                  \
+    MACH64_VERSION_STRINGIFY(MACH64_VERSION_MINOR) MACH64_VERSION_EXTRA
+
+#endif /* _MACH64_VERSION_H_ */
diff --git a/src/atimisc.c b/src/atimisc.c
index 7deda6e..d71b0ad 100644
--- a/src/atimisc.c
+++ b/src/atimisc.c
@@ -27,6 +27,8 @@
 #include "ati.h"
 #include "ativersion.h"
 
+#include "atimach64version.h"
+
 /* Module loader interface for subsidiary driver module */
 
 static XF86ModuleVersionInfo ATIVersionRec =
@@ -36,7 +38,7 @@ static XF86ModuleVersionInfo ATIVersionRec =
     MODINFOSTRING1,
     MODINFOSTRING2,
     XORG_VERSION_CURRENT,
-    ATI_VERSION_MAJOR, ATI_VERSION_MINOR, ATI_VERSION_PATCH,
+    MACH64_VERSION_MAJOR, MACH64_VERSION_MINOR, MACH64_VERSION_PATCH,
     ABI_CLASS_VIDEODRV,
     ABI_VIDEODRV_VERSION,
     MOD_CLASS_VIDEODRV,
@@ -62,38 +64,8 @@ ATISetup
     if (!Inited)
     {
         /* Ensure main driver module is loaded, but not as a submodule */
-        if (!xf86ServerIsOnlyDetecting())
-        {
-            if (!LoaderSymbol(ATI_NAME))
-                xf86LoadOneModule(ATI_DRIVER_NAME, Options);
-
-            /* ati & mach64 module versions must match */
-            do
-            {
-                XF86ModuleData *pModuleData = LoaderSymbol("atiModuleData");
-
-                if (pModuleData)
-                {
-                    XF86ModuleVersionInfo *pModuleInfo = pModuleData->vers;
-
-                    if ((pModuleInfo->majorversion == ATI_VERSION_MAJOR) &&
-                        (pModuleInfo->minorversion == ATI_VERSION_MINOR) &&
-                        (pModuleInfo->patchlevel == ATI_VERSION_PATCH))
-                        break;
-                }
-
-                xf86Msg(X_ERROR,
-                        "\"ati\" and \"mach64\" module versions must"
-                        " match.\n");
-
-                if (ErrorMajor)
-                    *ErrorMajor = (int)LDR_MISMATCH;
-                if (ErrorMinor)
-                    *ErrorMinor = (int)LDR_MISMATCH;
-
-                return NULL;
-            } while (0);
-        }
+        if (!xf86ServerIsOnlyDetecting() && !LoaderSymbol(ATI_NAME))
+            xf86LoadOneModule(ATI_DRIVER_NAME, Options);
 
         Inited = TRUE;
     }
diff --git a/src/atiprobe.c b/src/atiprobe.c
index 38ce90d..70e1a4a 100644
--- a/src/atiprobe.c
+++ b/src/atiprobe.c
@@ -32,8 +32,8 @@
 #include "atibus.h"
 #include "atichip.h"
 #include "atimach64io.h"
+#include "atimach64version.h"
 #include "atiprobe.h"
-#include "ativersion.h"
 #include "atividmem.h"
 #include "atiwonderio.h"
 
@@ -58,7 +58,7 @@ ATIVGAWonderProbe
             if (!pATI->OptionProbeSparse)
             {
                 xf86Msg(X_WARNING,
-                    ATI_NAME ":  Expected VGA Wonder capability at I/O port"
+                    MACH64_NAME ":  Expected VGA Wonder capability at I/O port"
                     " 0x%04lX will not be probed\n"
                     "set option \"probe_sparse\" to force probing.\n",
                     pATI->CPIO_VGAWonder);
@@ -96,13 +96,13 @@ ATIVGAWonderProbe
                 (IOValue6 == 0))
             {
                 xf86MsgVerb(X_INFO, 3,
-                    ATI_NAME ":  VGA Wonder at I/O port 0x%04lX detected.\n",
+                    MACH64_NAME ":  VGA Wonder at I/O port 0x%04lX detected.\n",
                     pATI->CPIO_VGAWonder);
             }
             else
             {
                 xf86Msg(X_WARNING,
-                    ATI_NAME ":  Expected VGA Wonder capability at I/O port"
+                    MACH64_NAME ":  Expected VGA Wonder capability at I/O port"
                     " 0x%04lX was not detected.\n", pATI->CPIO_VGAWonder);
                 pATI->CPIO_VGAWonder = 0;
             }
@@ -398,7 +398,7 @@ ATIMach64ProbeIO
 
         if (j == 0x03U)
         {
-            xf86Msg(X_WARNING, ATI_NAME ": "
+            xf86Msg(X_WARNING, MACH64_NAME ": "
                 "PCI Mach64 in slot %d:%d:%d cannot be enabled\n"
                 "because it has neither a block, nor a sparse, I/O base.\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo));
@@ -418,7 +418,7 @@ ATIMach64ProbeIO
          */
         if (!pATI->OptionProbeSparse)
         {
-            xf86Msg(X_WARNING, ATI_NAME ": "
+            xf86Msg(X_WARNING, MACH64_NAME ": "
                 "PCI Mach64 in slot %d:%d:%d will not be probed\n"
                 "set option \"probe_sparse\" to force sparse I/O probing.\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo));
@@ -439,14 +439,14 @@ ATIMach64ProbeIO
 
         if (!ATIMach64Probe(pATI, pVideo, pATI->Chip))
         {
-            xf86Msg(X_WARNING, ATI_NAME ": "
+            xf86Msg(X_WARNING, MACH64_NAME ": "
                 "PCI Mach64 in slot %d:%d:%d could not be detected!\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo));
         }
         else
         {
             ProbeSuccess = TRUE;
-            xf86Msg(X_INFO, ATI_NAME ": "
+            xf86Msg(X_INFO, MACH64_NAME ": "
                 "Shared PCI Mach64 in slot %d:%d:%d with sparse PIO base"
                 " 0x%04lX detected.\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo),
@@ -471,7 +471,7 @@ SkipSparse:
         if (ATIMach64Probe(pATI, pVideo, pATI->Chip))
         {
             ProbeSuccess = TRUE;
-            xf86Msg(X_INFO, ATI_NAME ": "
+            xf86Msg(X_INFO, MACH64_NAME ": "
                 "Shared PCI Mach64 in slot %d:%d:%d with Block 0 base"
                 " 0x%08lX detected.\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo),
@@ -479,7 +479,7 @@ SkipSparse:
         }
         else
         {
-            xf86Msg(X_WARNING, ATI_NAME ": "
+            xf86Msg(X_WARNING, MACH64_NAME ": "
                 "PCI Mach64 in slot %d:%d:%d could not be detected!\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo));
         }
@@ -497,7 +497,7 @@ SkipSparse:
         if (ATIMach64Probe(pATI, pVideo, pATI->Chip))
         {
             ProbeSuccess = TRUE;
-            xf86Msg(X_INFO, ATI_NAME ": "
+            xf86Msg(X_INFO, MACH64_NAME ": "
                 "Shared PCI/AGP Mach64 in slot %d:%d:%d detected.\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo));
 
@@ -511,7 +511,7 @@ SkipSparse:
         }
         else
         {
-            xf86Msg(X_WARNING, ATI_NAME ": "
+            xf86Msg(X_WARNING, MACH64_NAME ": "
                 "PCI/AGP Mach64 in slot %d:%d:%d could not be detected!\n",
                 PCI_DEV_BUS(pVideo), PCI_DEV_DEV(pVideo), PCI_DEV_FUNC(pVideo));
         }
commit 311ec7b6c54a50a4b8a5a445f7283da2b0b2e0f5
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sat Jan 12 16:17:21 2008 +0200

    atimisc: rename to mach64

diff --git a/man/ati.man b/man/ati.man
index c6c7d01..d8d84eb 100644
--- a/man/ati.man
+++ b/man/ati.man
@@ -17,7 +17,7 @@ ati \- ATI video driver
 is an __xservername__ wrapper driver for ATI video cards.  It autodetects
 whether your hardware has a Radeon, Rage 128, or Mach64 or earlier class of
 chipset, and loads the radeon(__drivermansuffix__),
-r128(__drivermansuffix__), or atimisc driver as
+r128(__drivermansuffix__), or mach64 driver as
 appropriate.
 .SH SUPPORTED HARDWARE
 The
diff --git a/src/Makefile.am b/src/Makefile.am
index 0f96e1c..661dcd8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,10 +86,10 @@ ati_drv_ladir = @moduledir@/drivers
 ati_drv_la_SOURCES = \
 	ati.c atimodule.c
 
-atimisc_drv_la_LTLIBRARIES = atimisc_drv.la
-atimisc_drv_la_LDFLAGS = -module -avoid-version
-atimisc_drv_ladir = @moduledir@/drivers
-atimisc_drv_la_SOURCES = \
+mach64_drv_la_LTLIBRARIES = mach64_drv.la
+mach64_drv_la_LDFLAGS = -module -avoid-version
+mach64_drv_ladir = @moduledir@/drivers
+mach64_drv_la_SOURCES = \
 	atibus.c atichip.c atiprobe.c atividmem.c \
 	atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \
 	atidac.c atidecoder.c atidsp.c atii2c.c \
diff --git a/src/ati.c b/src/ati.c
index 71177ba..5a4eb01 100644
--- a/src/ati.c
+++ b/src/ati.c
@@ -233,12 +233,12 @@ ATIProbe
     /* Call Mach64 driver probe */
     if (DoMach64)
     {
-        pointer atimisc = xf86LoadDrvSubModule(pDriver, "atimisc");
+        pointer mach64 = xf86LoadDrvSubModule(pDriver, "mach64");
 
-        if (!atimisc)
+        if (!mach64)
         {
             xf86Msg(X_ERROR,
-                ATI_NAME ":  Failed to load \"atimisc\" module.\n");
+                ATI_NAME ":  Failed to load \"mach64\" module.\n");
             return FALSE;
         }
 
@@ -247,7 +247,7 @@ ATIProbe
         if (Mach64Probe(pDriver, flags))
             return TRUE;
 
-        xf86UnloadSubModule(atimisc);
+        xf86UnloadSubModule(mach64);
     }
 
     return FALSE;
diff --git a/src/atimach64probe.c b/src/atimach64probe.c
index 2f716a1..b365b09 100644
--- a/src/atimach64probe.c
+++ b/src/atimach64probe.c
@@ -110,7 +110,7 @@ _X_EXPORT const OptionInfoRec *
 Mach64AvailableOptions(int chipid, int busid)
 {
     /*
-     * Return options defined in the atimisc submodule which will have been
+     * Return options defined in the mach64 submodule which will have been
      * loaded by this point.
      */
     return ATIOptionsWeak();
diff --git a/src/atimisc.c b/src/atimisc.c
index b10d08f..7deda6e 100644
--- a/src/atimisc.c
+++ b/src/atimisc.c
@@ -31,7 +31,7 @@
 
 static XF86ModuleVersionInfo ATIVersionRec =
 {
-    "atimisc",
+    "mach64",
     MODULEVENDORSTRING,
     MODINFOSTRING1,
     MODINFOSTRING2,
@@ -67,7 +67,7 @@ ATISetup
             if (!LoaderSymbol(ATI_NAME))
                 xf86LoadOneModule(ATI_DRIVER_NAME, Options);
 
-            /* ati & atimisc module versions must match */
+            /* ati & mach64 module versions must match */
             do
             {
                 XF86ModuleData *pModuleData = LoaderSymbol("atiModuleData");
@@ -83,7 +83,7 @@ ATISetup
                 }
 
                 xf86Msg(X_ERROR,
-                        "\"ati\" and \"atimisc\" module versions must"
+                        "\"ati\" and \"mach64\" module versions must"
                         " match.\n");
 
                 if (ErrorMajor)
@@ -101,8 +101,8 @@ ATISetup
     return (pointer)TRUE;
 }
 
-/* The following record must be called atimiscModuleData */
-_X_EXPORT XF86ModuleData atimiscModuleData =
+/* The following record must be called mach64ModuleData */
+_X_EXPORT XF86ModuleData mach64ModuleData =
 {
     &ATIVersionRec,
     ATISetup,


More information about the xorg-commit mailing list