summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2008-02-15 18:36:10 +0200
committerGeorge Sapountzis <gsap7@yahoo.gr>2008-02-15 18:36:10 +0200
commitfc85188fd95bf78b7f965cdde3e22b644c74ff81 (patch)
tree38200fd137c83d542406457caab1ef23f6505534 /src
parent665bd7e2f61cac3e029bbad5024034e5136deec1 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/atimach64probe.c130
-rw-r--r--src/atimisc.c2
-rw-r--r--src/atipcirename.h3
-rwxr-xr-xsrc/pcidb/parse_pci_ids.pl8
-rw-r--r--src/r128_misc.c2
-rw-r--r--src/r128_probe.c219
-rw-r--r--src/radeon_misc.c2
-rw-r--r--src/radeon_pci_device_match_gen.h280
-rw-r--r--src/radeon_probe.c165
10 files changed, 658 insertions, 154 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 069076b5..a146df30 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 2b701d71..087ab497 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 0bcbff5b..ebfde549 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 5aa6b808..de8f0a39 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 e6eac76f..a3a8af89 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 5eb6fac0..2dc6040a 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 8fc65cb8..78951663 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)
- {
- 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);
- }
+ if (r128_get_scrninfo(entity_num))
+ foundScreen = TRUE;
}
xfree(usedChips);
@@ -265,13 +338,37 @@ R128Probe(DriverPtr drv, int flags)
return foundScreen;
}
+#else /* XSERVER_LIBPCIACCESS */
+
+static Bool
+r128_pci_probe(
+ DriverPtr pDriver,
+ int entity_num,
+ struct pci_device *device,
+ intptr_t match_data
+)
+{
+ return r128_get_scrninfo(entity_num);
+}
+
+#endif /* XSERVER_LIBPCIACCESS */
+
_X_EXPORT DriverRec R128 =
{
R128_VERSION_CURRENT,
R128_DRIVER_NAME,
R128Identify,
+#ifdef XSERVER_LIBPCIACCESS
+ NULL,
+#else
R128Probe,
+#endif
R128AvailableOptions,
NULL,
- 0
+ 0,
+ NULL,
+#ifdef XSERVER_LIBPCIACCESS
+ r128_device_match,
+ r128_pci_probe
+#endif
};
diff --git a/src/radeon_misc.c b/src/radeon_misc.c
index a5a2cccc..1115118a 100644
--- a/src/radeon_misc.c
+++ b/src/radeon_misc.c
@@ -63,7 +63,7 @@ RADEONSetup
if (!Inited) {
Inited = TRUE;
- xf86AddDriver(&RADEON, Module, 0);
+ xf86AddDriver(&RADEON, Module, HaveDriverFuncs);
}
return (pointer)TRUE;
diff --git a/src/radeon_pci_device_match_gen.h b/src/radeon_pci_device_match_gen.h
new file mode 100644
index 00000000..04393da4
--- /dev/null
+++ b/src/radeon_pci_device_match_gen.h
@@ -0,0 +1,280 @@
+/* This file is autogenerated please do not edit */
+static const struct pci_id_match radeon_device_match[] = {
+ ATI_DEVICE_MATCH( PCI_CHIP_RV380_3150, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV380_3152, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV380_3154, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV380_3E50, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV380_3E54, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS100_4136, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS200_4137, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_AD, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_AE, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_AF, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_AG, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R350_AH, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R350_AI, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R350_AJ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R350_AK, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_AP, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_AQ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV360_AR, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_AS, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_AT, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_4155, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_AV, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS250_4237, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R200_BB, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R200_BC, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS100_4336, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS200_4337, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS250_4437, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV250_If, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV250_Ig, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JH, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JI, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JJ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JK, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JL, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JM, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JN, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_4A4F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R420_JP, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R481_4B49, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R481_4B4A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R481_4B4B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R481_4B4C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_LW, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_LX, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_LY, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_LZ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV250_Ld, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV250_Lf, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV250_Lg, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_ND, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_NE, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_NF, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R300_NG, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R350_NH, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R350_NI, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R360_NJ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R350_NK, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_NP, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_NQ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_NR, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_NS, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_NT, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV350_NV, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_QD, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_QE, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_QF, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RADEON_QG, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R200_QH, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R200_QL, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R200_QM, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV200_QW, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV200_QX, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV100_QY, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV100_QZ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RN50_515E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5460, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5462, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5464, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_UH, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_UI, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_UJ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_UK, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R430_554C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R430_554D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R430_554E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R430_554F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_5550, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_UQ, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_UR, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_UT, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_564A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_564B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_564F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5652, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5653, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS300_5834, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS300_5835, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS480_5954, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS480_5955, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV280_5960, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV280_5961, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV280_5962, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV280_5964, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV280_5965, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RN50_5969, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS482_5974, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS485_5975, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS400_5A41, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS400_5A42, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RC410_5A61, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RC410_5A62, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5B60, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5B62, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5B63, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5657, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5B64, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV370_5B65, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV280_5C61, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV280_5C63, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R430_5D48, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R430_5D49, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R430_5D4A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R480_5D4C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R480_5D4D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R480_5D4E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R480_5D4F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R480_5D50, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R480_5D52, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R423_5D57, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5E48, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5E4A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5E4B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5E4C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5E4D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV410_5E4F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7100, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7101, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7102, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7103, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7104, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7105, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7106, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7108, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_7109, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_710A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_710B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_710C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_710E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R520_710F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7140, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7141, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7142, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7143, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7144, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7145, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7146, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7147, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7149, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_714A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_714B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_714C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_714D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_714E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_714F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7151, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7152, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7153, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_715E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_715F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7180, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7181, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7183, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7186, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7187, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7188, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_718A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_718B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_718C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_718D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_718F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7193, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_7196, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_719B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV515_719F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C0, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C1, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C2, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C3, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C4, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C5, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C6, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71C7, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71CD, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71CE, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71D2, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71D4, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71D5, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71D6, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71DA, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_71DE, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_7200, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_7210, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV530_7211, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7240, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7243, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7244, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7245, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7246, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7247, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7248, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7249, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_724A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_724B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_724C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_724D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_724E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_724F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV570_7280, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV560_7281, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV560_7283, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R580_7284, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV560_7287, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV570_7288, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV570_7289, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV570_728B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV570_728C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV560_7290, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV560_7291, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV560_7293, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV560_7297, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS350_7834, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS350_7835, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS690_791E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS690_791F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS740_796C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS740_796D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS740_796E, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RS740_796F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_9400, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_9401, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_9402, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_9403, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_9405, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_940A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_940B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_R600_940F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C0, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C1, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C3, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C4, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C5, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C6, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C7, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C8, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94C9, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94CB, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV610_94CC, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV670_9500, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV670_9501, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV670_9505, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV670_9507, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV670_950F, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV670_9511, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_9580, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_9581, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_9583, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_9586, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_9587, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_9588, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_9589, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_958A, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_958B, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_958C, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_958D, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_RV630_958E, 0 ),
+ { 0, 0, 0 }
+};
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index 49745309..658f9090 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -41,6 +41,7 @@
#include "radeon_probe.h"
#include "radeon_version.h"
#include "atipciids.h"
+#include "atipcirename.h"
#include "xf86.h"
#define _XF86MISC_SERVER_
@@ -51,6 +52,10 @@
#include "radeon_pci_chipset_gen.h"
+#ifdef XSERVER_LIBPCIACCESS
+#include "radeon_pci_device_match_gen.h"
+#endif
+
int gRADEONEntityIndex = -1;
/* Return the options for supported chipset 'n'; NULL otherwise */
@@ -69,6 +74,76 @@ RADEONIdentify(int flags)
RADEONChipsets);
}
+static Bool
+radeon_get_scrninfo(int entity_num)
+{
+ ScrnInfoPtr pScrn = NULL;
+ EntityInfoPtr pEnt;
+
+ pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, RADEONPciChipsets,
+ NULL,
+ NULL, NULL, NULL, NULL);
+
+ if (!pScrn)
+ return FALSE;
+
+ pScrn->driverVersion = RADEON_VERSION_CURRENT;
+ pScrn->driverName = RADEON_DRIVER_NAME;
+ pScrn->name = RADEON_NAME;
+#ifdef XSERVER_LIBPCIACCESS
+ pScrn->Probe = NULL;
+#else
+ pScrn->Probe = RADEONProbe;
+#endif
+ pScrn->PreInit = RADEONPreInit;
+ pScrn->ScreenInit = RADEONScreenInit;
+ pScrn->SwitchMode = RADEONSwitchMode;
+ pScrn->AdjustFrame = RADEONAdjustFrame;
+ pScrn->EnterVT = RADEONEnterVT;
+ pScrn->LeaveVT = RADEONLeaveVT;
+ pScrn->FreeScreen = RADEONFreeScreen;
+ pScrn->ValidMode = RADEONValidMode;
+
+ pEnt = xf86GetEntityInfo(entity_num);
+
+ /* Create a RADEONEntity for all chips, even with old single head
+ * Radeon, need to use pRADEONEnt for new monitor detection routines.
+ */
+ {
+ DevUnion *pPriv;
+ RADEONEntPtr pRADEONEnt;
+
+ xf86SetEntitySharable(entity_num);
+
+ if (gRADEONEntityIndex == -1)
+ gRADEONEntityIndex = xf86AllocateEntityPrivateIndex();
+
+ pPriv = xf86GetEntityPrivate(pEnt->index,
+ gRADEONEntityIndex);
+
+ if (!pPriv->ptr) {
+ int j;
+ int instance = xf86GetNumEntityInstances(pEnt->index);
+
+ for (j = 0; j < instance; j++)
+ xf86SetEntityInstanceForScreen(pScrn, pEnt->index, j);
+
+ pPriv->ptr = xnfcalloc(sizeof(RADEONEntRec), 1);
+ pRADEONEnt = pPriv->ptr;
+ pRADEONEnt->HasSecondary = FALSE;
+ } else {
+ pRADEONEnt = pPriv->ptr;
+ pRADEONEnt->HasSecondary = TRUE;
+ }
+ }
+
+ xfree(pEnt);
+
+ return TRUE;
+}
+
+#ifndef XSERVER_LIBPCIACCESS
+
/* Return TRUE if chipset is present; FALSE otherwise. */
static Bool
RADEONProbe(DriverPtr drv, int flags)
@@ -80,9 +155,7 @@ RADEONProbe(DriverPtr drv, int flags)
Bool foundScreen = FALSE;
int i;
-#ifndef XSERVER_LIBPCIACCESS
if (!xf86GetPciVideoInfo()) return FALSE;
-#endif
numDevSections = xf86MatchDevice(RADEON_NAME, &devSections);
@@ -103,66 +176,8 @@ RADEONProbe(DriverPtr drv, int flags)
foundScreen = TRUE;
} else {
for (i = 0; i < numUsed; i++) {
- ScrnInfoPtr pScrn = NULL;
- EntityInfoPtr pEnt;
- pEnt = xf86GetEntityInfo(usedChips[i]);
- if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
- RADEONPciChipsets, 0, 0, 0,
- 0, 0))) {
- pScrn->driverVersion = RADEON_VERSION_CURRENT;
- pScrn->driverName = RADEON_DRIVER_NAME;
- pScrn->name = RADEON_NAME;
- pScrn->Probe = RADEONProbe;
- pScrn->PreInit = RADEONPreInit;
- pScrn->ScreenInit = RADEONScreenInit;
- pScrn->SwitchMode = RADEONSwitchMode;
-#ifdef X_XF86MiscPassMessage
- pScrn->HandleMessage = RADEONHandleMessage;
-#endif
- pScrn->AdjustFrame = RADEONAdjustFrame;
- pScrn->EnterVT = RADEONEnterVT;
- pScrn->LeaveVT = RADEONLeaveVT;
- pScrn->FreeScreen = RADEONFreeScreen;
- pScrn->ValidMode = RADEONValidMode;
-
- foundScreen = TRUE;
- }
-
- xfree(pEnt);
- pEnt = xf86GetEntityInfo(usedChips[i]);
-
- /* create a RADEONEntity for all chips, even with
- old single head Radeon, need to use pRADEONEnt
- for new monitor detection routines
- */
- {
- DevUnion *pPriv;
- RADEONEntPtr pRADEONEnt;
-
- xf86SetEntitySharable(usedChips[i]);
-
- if (gRADEONEntityIndex == -1)
- gRADEONEntityIndex = xf86AllocateEntityPrivateIndex();
-
- pPriv = xf86GetEntityPrivate(pEnt->index,
- gRADEONEntityIndex);
-
- if (!pPriv->ptr) {
- int j;
- int instance = xf86GetNumEntityInstances(pEnt->index);
-
- for (j = 0; j < instance; j++)
- xf86SetEntityInstanceForScreen(pScrn, pEnt->index, j);
-
- pPriv->ptr = xnfcalloc(sizeof(RADEONEntRec), 1);
- pRADEONEnt = pPriv->ptr;
- pRADEONEnt->HasSecondary = FALSE;
- } else {
- pRADEONEnt = pPriv->ptr;
- pRADEONEnt->HasSecondary = TRUE;
- }
- }
- xfree(pEnt);
+ if (radeon_get_scrninfo(entity_num))
+ foundScreen = TRUE;
}
}
@@ -172,13 +187,37 @@ RADEONProbe(DriverPtr drv, int flags)
return foundScreen;
}
+#else /* XSERVER_LIBPCIACCESS */
+
+static Bool
+radeon_pci_probe(
+ DriverPtr pDriver,
+ int entity_num,
+ struct pci_device *device,
+ intptr_t match_data
+)
+{
+ return radeon_get_scrninfo(entity_num);
+}
+
+#endif /* XSERVER_LIBPCIACCESS */
+
_X_EXPORT DriverRec RADEON =
{
RADEON_VERSION_CURRENT,
RADEON_DRIVER_NAME,
RADEONIdentify,
+#ifdef XSERVER_LIBPCIACCESS
+ NULL,
+#else
RADEONProbe,
+#endif
RADEONAvailableOptions,
NULL,
- 0
+ 0,
+ NULL,
+#ifdef XSERVER_LIBPCIACCESS
+ radeon_device_match,
+ radeon_pci_probe
+#endif
};