summaryrefslogtreecommitdiff
path: root/src/atimach64probe.c
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2008-01-12 16:18:07 +0200
committerGeorge Sapountzis <gsap7@yahoo.gr>2008-01-16 16:15:56 +0200
commit19e1b180fec6f83a474e125465bc60111c0f43e0 (patch)
tree73aca42837e061215572fc3858e55f698571ed08 /src/atimach64probe.c
parent92f54400d5450b29b3a76d5ecc927cf0d73e156e (diff)
mach64: load for both "ati" and "mach64" as driver names
similar to r128/radeon
Diffstat (limited to 'src/atimach64probe.c')
-rw-r--r--src/atimach64probe.c28
1 files changed, 25 insertions, 3 deletions
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,