commit 2904b25828edc4f399204c9d343d646fb9cbcbe2 Author: George Sapountzis Date: Thu Mar 8 07:54:56 2007 +0200 [mach64] Convert driver to the new PCI interfaces. diff --git a/configure.ac b/configure.ac index 16b93e1..5c4e7fb 100644 --- a/configure.ac +++ b/configure.ac @@ -204,6 +204,9 @@ CPPFLAGS="$SAVE_CPPFLAGS" AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes) +PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) +XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" + AC_SUBST([XORG_CFLAGS]) AC_SUBST([DRI_CFLAGS]) AC_SUBST([moduledir]) diff --git a/src/ati.c b/src/ati.c index bf97197..7c7ef22 100644 --- a/src/ati.c +++ b/src/ati.c @@ -57,6 +57,8 @@ #include "config.h" #endif +#include + #include "ati.h" #include "atichip.h" #include "ativersion.h" @@ -67,6 +69,51 @@ #include "r128_probe.h" #include "r128_version.h" +#define ATI_DEVICE_MATCH(d, i) \ + { PCI_VENDOR_ATI, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) } + +static const struct pci_id_match +ati_device_match[] = { + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GX, ATI_CHIP_88800GX), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64CX, ATI_CHIP_88800CX), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64CT, ATI_CHIP_264CT), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64ET, ATI_CHIP_264ET), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64VT, ATI_CHIP_264VT), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GT, ATI_CHIP_264GT), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64VU, ATI_CHIP_264VT3), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GU, ATI_CHIP_264GTDVD), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LG, ATI_CHIP_264LT), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64VV, ATI_CHIP_264VT4), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GV, ATI_CHIP_264GT2C), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GW, ATI_CHIP_264GT2C), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GY, ATI_CHIP_264GT2C), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GZ, ATI_CHIP_264GT2C), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GB, ATI_CHIP_264GTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GD, ATI_CHIP_264GTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GI, ATI_CHIP_264GTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GP, ATI_CHIP_264GTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GQ, ATI_CHIP_264GTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LB, ATI_CHIP_264LTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LD, ATI_CHIP_264LTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LI, ATI_CHIP_264LTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LP, ATI_CHIP_264LTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LQ, ATI_CHIP_264LTPRO), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GL, ATI_CHIP_264XL), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GM, ATI_CHIP_264XL), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GN, ATI_CHIP_264XL), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GO, ATI_CHIP_264XL), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GR, ATI_CHIP_264XL), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64GS, ATI_CHIP_264XL), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LM, ATI_CHIP_MOBILITY), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LN, ATI_CHIP_MOBILITY), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LR, ATI_CHIP_MOBILITY), + ATI_DEVICE_MATCH(PCI_CHIP_MACH64LS, ATI_CHIP_MOBILITY), + + /* FIXME: fill in r128 and radeon pciid's here */ + + {0, 0, 0} +}; + /* * ATIIdentify -- * @@ -91,66 +138,35 @@ ATIIdentify * do a minimal probe for supported hardware. */ static Bool -ATIProbe -( - DriverPtr pDriver, - int flags -) +ATIPciProbe(DriverPtr pDriver, int entity_num, struct pci_device *dev, + intptr_t match_data) { - pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); - Bool ProbeSuccess = FALSE; - Bool DoMach64 = FALSE; - Bool DoRage128 = FALSE, DoRadeon = FALSE; - int i; - ATIChipType Chip; - - if (!(flags & PROBE_DETECT)) - { - if (xf86MatchDevice(ATI_NAME, NULL) > 0) - DoMach64 = TRUE; - if (xf86MatchDevice(R128_NAME, NULL) > 0) - DoRage128 = TRUE; - if (xf86MatchDevice(RADEON_NAME, NULL) > 0) - DoRadeon = TRUE; - } - - if (xf86PciVideoInfo) - { - for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) - { - if ((pVideo->vendor != PCI_VENDOR_ATI) || - (pVideo->chipType == PCI_CHIP_MACH32)) - continue; - - /* Check for Rage128's, Radeon's and later adapters */ - Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); - if (Chip > ATI_CHIP_Mach64) - { - if (Chip <= ATI_CHIP_Rage128) - DoRage128 = TRUE; - else if (Chip <= ATI_CHIP_Radeon) - DoRadeon = TRUE; - - continue; - } - - DoMach64 = TRUE; - } - } + Bool DoMach64 = FALSE; + Bool DoRage128 = FALSE, DoRadeon = FALSE; + + DoMach64 = ((match_data >= ATI_CHIP_88800GX) && + (match_data <= ATI_CHIP_MOBILITY)); + + DoRage128 = ((match_data >= ATI_CHIP_RAGE128GL) && + (match_data <= ATI_CHIP_RAGE128MOBILITY4)); + + DoRadeon = ((match_data >= ATI_CHIP_RADEON) && + (match_data <= ATI_CHIP_RS400)) || + (match_data == ATI_CHIP_HDTV); /* Call Mach64 driver probe */ - if (DoMach64 && Mach64Probe(pDriver, flags)) - ProbeSuccess = TRUE; + if (DoMach64) + return Mach64PciProbe(pDriver, entity_num, dev, match_data); /* Call Rage 128 driver probe */ - if (DoRage128 && R128Probe(pDriver, flags)) - ProbeSuccess = TRUE; + if (DoRage128) + return R128PciProbe(pDriver, entity_num, dev, match_data); /* Call Radeon driver probe */ - if (DoRadeon && RADEONProbe(pDriver, flags)) - ProbeSuccess = TRUE; + if (DoRadeon) + return RADEONPciProbe(pDriver, entity_num, dev, match_data); - return ProbeSuccess; + return FALSE; } /* @@ -182,9 +198,12 @@ _X_EXPORT DriverRec ATI = ATI_VERSION_CURRENT, "ati", ATIIdentify, - ATIProbe, + NULL, ATIAvailableOptions, NULL, 0, - NULL + NULL, + + ati_device_match, + ATIPciProbe }; diff --git a/src/atichip.c b/src/atichip.c index ddc7e0a..46eaabb 100644 --- a/src/atichip.c +++ b/src/atichip.c @@ -373,399 +373,3 @@ ATIMach64ChipID break; } } - -/* - * ATIChipID -- - * - * This returns the ATI_CHIP_* value (generally) associated with a particular - * ChipID/ChipRev combination. - */ -ATIChipType -ATIChipID -( - const CARD16 ChipID, - const CARD8 ChipRev -) -{ - switch (ChipID) - { - case OldChipID('G', 'X'): case NewChipID('G', 'X'): - switch (ChipRev) - { - case 0x00U: - return ATI_CHIP_88800GXC; - - case 0x01U: - return ATI_CHIP_88800GXD; - - case 0x02U: - return ATI_CHIP_88800GXE; - - case 0x03U: - return ATI_CHIP_88800GXF; - - default: - return ATI_CHIP_88800GX; - } - - case OldChipID('C', 'X'): case NewChipID('C', 'X'): - return ATI_CHIP_88800CX; - - case OldChipID('C', 'T'): case NewChipID('C', 'T'): - return ATI_CHIP_264CT; - - case OldChipID('E', 'T'): case NewChipID('E', 'T'): - return ATI_CHIP_264ET; - - case OldChipID('V', 'T'): case NewChipID('V', 'T'): - /* For simplicity, ignore ChipID discrepancy that can occur here */ - if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV))) - return ATI_CHIP_264VT; - return ATI_CHIP_264VTB; - - case OldChipID('G', 'T'): case NewChipID('G', 'T'): - if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV))) - return ATI_CHIP_264GT; - return ATI_CHIP_264GTB; - - case OldChipID('V', 'U'): case NewChipID('V', 'U'): - return ATI_CHIP_264VT3; - - case OldChipID('G', 'U'): case NewChipID('G', 'U'): - return ATI_CHIP_264GTDVD; - - case OldChipID('L', 'G'): case NewChipID('L', 'G'): - return ATI_CHIP_264LT; - - case OldChipID('V', 'V'): case NewChipID('V', 'V'): - return ATI_CHIP_264VT4; - - case OldChipID('G', 'V'): case NewChipID('G', 'V'): - case OldChipID('G', 'W'): case NewChipID('G', 'W'): - case OldChipID('G', 'Y'): case NewChipID('G', 'Y'): - case OldChipID('G', 'Z'): case NewChipID('G', 'Z'): - return ATI_CHIP_264GT2C; - - case OldChipID('G', 'B'): case NewChipID('G', 'B'): - case OldChipID('G', 'D'): case NewChipID('G', 'D'): - case OldChipID('G', 'I'): case NewChipID('G', 'I'): - case OldChipID('G', 'P'): case NewChipID('G', 'P'): - case OldChipID('G', 'Q'): case NewChipID('G', 'Q'): - return ATI_CHIP_264GTPRO; - - case OldChipID('L', 'B'): case NewChipID('L', 'B'): - case OldChipID('L', 'D'): case NewChipID('L', 'D'): - case OldChipID('L', 'I'): case NewChipID('L', 'I'): - case OldChipID('L', 'P'): case NewChipID('L', 'P'): - case OldChipID('L', 'Q'): case NewChipID('L', 'Q'): - return ATI_CHIP_264LTPRO; - - case OldChipID('G', 'L'): case NewChipID('G', 'L'): - case OldChipID('G', 'M'): case NewChipID('G', 'M'): - case OldChipID('G', 'N'): case NewChipID('G', 'N'): - case OldChipID('G', 'O'): case NewChipID('G', 'O'): - case OldChipID('G', 'R'): case NewChipID('G', 'R'): - case OldChipID('G', 'S'): case NewChipID('G', 'S'): - return ATI_CHIP_264XL; - - case OldChipID('L', 'M'): case NewChipID('L', 'M'): - case OldChipID('L', 'N'): case NewChipID('L', 'N'): - case OldChipID('L', 'R'): case NewChipID('L', 'R'): - case OldChipID('L', 'S'): case NewChipID('L', 'S'): - return ATI_CHIP_MOBILITY; - - case NewChipID('R', 'E'): - case NewChipID('R', 'F'): - case NewChipID('R', 'G'): - case NewChipID('S', 'K'): - case NewChipID('S', 'L'): - case NewChipID('S', 'M'): - /* "SN" is listed as ATI_CHIP_RAGE128_4X in ATI docs */ - case NewChipID('S', 'N'): - return ATI_CHIP_RAGE128GL; - - case NewChipID('R', 'K'): - case NewChipID('R', 'L'): - /* - * ATI documentation lists SE/SF/SG under both ATI_CHIP_RAGE128VR - * and ATI_CHIP_RAGE128_4X, and lists SH/SK/SL under Rage 128 4X only. - * I'm stuffing them here for now until this can be clarified as ATI - * documentation doesn't mention their details. - */ - case NewChipID('S', 'E'): - case NewChipID('S', 'F'): - case NewChipID('S', 'G'): - case NewChipID('S', 'H'): - return ATI_CHIP_RAGE128VR; - - /* case NewChipID('S', 'H'): */ - /* case NewChipID('S', 'K'): */ - /* case NewChipID('S', 'L'): */ - /* case NewChipID('S', 'N'): */ - /* return ATI_CHIP_RAGE128_4X; */ - - case NewChipID('P', 'A'): - case NewChipID('P', 'B'): - case NewChipID('P', 'C'): - case NewChipID('P', 'D'): - case NewChipID('P', 'E'): - case NewChipID('P', 'F'): - return ATI_CHIP_RAGE128PROGL; - - case NewChipID('P', 'G'): - case NewChipID('P', 'H'): - case NewChipID('P', 'I'): - case NewChipID('P', 'J'): - case NewChipID('P', 'K'): - case NewChipID('P', 'L'): - case NewChipID('P', 'M'): - case NewChipID('P', 'N'): - case NewChipID('P', 'O'): - case NewChipID('P', 'P'): - case NewChipID('P', 'Q'): - case NewChipID('P', 'R'): - case NewChipID('P', 'S'): - case NewChipID('P', 'T'): - case NewChipID('P', 'U'): - case NewChipID('P', 'V'): - case NewChipID('P', 'W'): - case NewChipID('P', 'X'): - return ATI_CHIP_RAGE128PROVR; - - case NewChipID('T', 'F'): - case NewChipID('T', 'L'): - case NewChipID('T', 'R'): - case NewChipID('T', 'S'): - case NewChipID('T', 'T'): - case NewChipID('T', 'U'): - return ATI_CHIP_RAGE128PROULTRA; - - case NewChipID('L', 'E'): - case NewChipID('L', 'F'): - /* - * "LK" and "LL" are not in any ATI documentation I can find - * - mharris - */ - case NewChipID('L', 'K'): - case NewChipID('L', 'L'): - return ATI_CHIP_RAGE128MOBILITY3; - - case NewChipID('M', 'F'): - case NewChipID('M', 'L'): - return ATI_CHIP_RAGE128MOBILITY4; - - case NewChipID('Q', 'D'): - case NewChipID('Q', 'E'): - case NewChipID('Q', 'F'): - case NewChipID('Q', 'G'): - return ATI_CHIP_RADEON; - - case NewChipID('Q', 'Y'): - case NewChipID('Q', 'Z'): - case NewChipID('Q', '^'): - return ATI_CHIP_RADEONVE; - - case NewChipID('L', 'Y'): - case NewChipID('L', 'Z'): - return ATI_CHIP_RADEONMOBILITY6; - - case NewChipID('A', '6'): - case NewChipID('C', '6'): - return ATI_CHIP_RS100; - - case NewChipID('A', '7'): - case NewChipID('C', '7'): - return ATI_CHIP_RS200; - - case NewChipID('D', '7'): - case NewChipID('B', '7'): - return ATI_CHIP_RS250; - - case NewChipID('L', 'W'): - case NewChipID('L', 'X'): - return ATI_CHIP_RADEONMOBILITY7; - - case NewChipID('Q', 'H'): - case NewChipID('Q', 'I'): - case NewChipID('Q', 'J'): - case NewChipID('Q', 'K'): - case NewChipID('Q', 'L'): - case NewChipID('Q', 'M'): - case NewChipID('Q', 'N'): - case NewChipID('Q', 'O'): - case NewChipID('Q', 'h'): - case NewChipID('Q', 'i'): - case NewChipID('Q', 'j'): - case NewChipID('Q', 'k'): - case NewChipID('Q', 'l'): - case NewChipID('B', 'B'): - return ATI_CHIP_R200; - - case NewChipID('Q', 'W'): - case NewChipID('Q', 'X'): - return ATI_CHIP_RV200; - - case NewChipID('I', 'f'): - case NewChipID('I', 'g'): - return ATI_CHIP_RV250; - - case NewChipID('L', 'd'): - case NewChipID('L', 'f'): - case NewChipID('L', 'g'): - return ATI_CHIP_RADEONMOBILITY9; - - case NewChipID('X', '4'): - case NewChipID('X', '5'): - return ATI_CHIP_RS300; - - case NewChipID('x', '4'): - case NewChipID('x', '5'): - return ATI_CHIP_RS350; - - case NewChipID('Y', '\''): - case NewChipID('Y', 'a'): - case NewChipID('Y', 'b'): - case NewChipID('Y', 'd'): - case NewChipID('Y', 'e'): - return ATI_CHIP_RV280; - - case NewChipID('\\', 'a'): - case NewChipID('\\', 'c'): - return ATI_CHIP_RADEONMOBILITY9PLUS; - - case NewChipID('A', 'D'): - case NewChipID('A', 'E'): - case NewChipID('A', 'F'): - case NewChipID('A', 'G'): - case NewChipID('N', 'D'): - case NewChipID('N', 'E'): - case NewChipID('N', 'F'): - case NewChipID('N', 'G'): - return ATI_CHIP_R300; - - case NewChipID('A', 'H'): - case NewChipID('A', 'I'): - case NewChipID('A', 'J'): - case NewChipID('A', 'K'): - case NewChipID('N', 'H'): - case NewChipID('N', 'I'): - case NewChipID('N', 'K'): - return ATI_CHIP_R350; - - case NewChipID('A', 'P'): - case NewChipID('A', 'Q'): - case NewChipID('A', 'R'): - case NewChipID('A', 'S'): - case NewChipID('A', 'T'): - case NewChipID('A', 'U'): - case NewChipID('A', 'V'): - case NewChipID('N', 'P'): - case NewChipID('N', 'Q'): - case NewChipID('N', 'R'): - case NewChipID('N', 'S'): - case NewChipID('N', 'T'): - case NewChipID('N', 'V'): - return ATI_CHIP_RV350; - - case NewChipID('N', 'J'): - return ATI_CHIP_R360; - - case NewChipID('[', '\''): - case NewChipID('[', 'b'): - case NewChipID('[', 'c'): - case NewChipID('[', 'd'): - case NewChipID('[', 'e'): - case NewChipID('T', '\''): - case NewChipID('T', 'b'): - case NewChipID('T', 'd'): - return ATI_CHIP_RV370; - - case NewChipID('>', 'P'): - case NewChipID('>', 'T'): - case NewChipID('1', 'P'): - case NewChipID('1', 'R'): - case NewChipID('1', 'T'): - return ATI_CHIP_RV380; - - case NewChipID('J', 'H'): - case NewChipID('J', 'I'): - case NewChipID('J', 'J'): - case NewChipID('J', 'K'): - case NewChipID('J', 'L'): - case NewChipID('J', 'M'): - case NewChipID('J', 'N'): - case NewChipID('J', 'O'): - case NewChipID('J', 'P'): - case NewChipID('J', 'T'): - return ATI_CHIP_R420; - - case NewChipID('U', 'H'): - case NewChipID('U', 'I'): - case NewChipID('U', 'J'): - case NewChipID('U', 'K'): - case NewChipID('U', 'P'): - case NewChipID('U', 'Q'): - case NewChipID('U', 'R'): - case NewChipID('U', 'T'): - case NewChipID(']', 'W'): - /* those are m28, not 100% certain they are r423 could - be r480 but not r430 as their pci id names indicate... */ - case NewChipID(']', 'H'): - case NewChipID(']', 'I'): - case NewChipID(']', 'J'): - return ATI_CHIP_R423; - - case NewChipID('U', 'L'): - case NewChipID('U', 'M'): - case NewChipID('U', 'N'): - case NewChipID('U', 'O'): - return ATI_CHIP_R430; - - case NewChipID(']', 'L'): - case NewChipID(']', 'M'): - case NewChipID(']', 'N'): - case NewChipID(']', 'O'): - case NewChipID(']', 'P'): - case NewChipID(']', 'R'): - return ATI_CHIP_R480; - - case NewChipID('K', 'I'): - case NewChipID('K', 'J'): - case NewChipID('K', 'K'): - case NewChipID('K', 'L'): - return ATI_CHIP_R481; - - case NewChipID('^', 'H'): - case NewChipID('^', 'J'): - case NewChipID('^', 'K'): - case NewChipID('^', 'L'): - case NewChipID('^', 'M'): - case NewChipID('^', 'O'): - case NewChipID('V', 'J'): - case NewChipID('V', 'K'): - case NewChipID('V', 'O'): - case NewChipID('V', 'R'): - case NewChipID('V', 'S'): - return ATI_CHIP_RV410; - - case NewChipID('Z', 'A'): - case NewChipID('Z', 'B'): - case NewChipID('Z', 'a'): - case NewChipID('Z', 'b'): - case NewChipID('Y', 'T'): - case NewChipID('Y', 'U'): - case NewChipID('Y', 't'): - case NewChipID('Y', 'u'): - return ATI_CHIP_RS400; - - case NewChipID('H', 'D'): - return ATI_CHIP_HDTV; - - default: - /* - * Treat anything else as an unknown Radeon. Please keep the above - * up-to-date however, as it serves as a central chip list. - */ - return ATI_CHIP_Radeon; - } -} diff --git a/src/atichip.h b/src/atichip.h index 733c7b1..6f3b3fc 100644 --- a/src/atichip.h +++ b/src/atichip.h @@ -116,7 +116,6 @@ typedef enum extern const char *ATIFoundryNames[]; extern void ATIMach64ChipID(ATIPtr, const CARD16); -extern ATIChipType ATIChipID(const CARD16, const CARD8); #define OldChipID(_1, _0) \ (SetBits(_0 - 'A', CHIP_CODE_0) | SetBits(_1 - 'A', CHIP_CODE_1)) diff --git a/src/atidri.c b/src/atidri.c index 83cb25f..d43bc94 100644 --- a/src/atidri.c +++ b/src/atidri.c @@ -774,8 +774,8 @@ static Bool ATIDRISetAgpMode( ScreenPtr pScreen ) xf86DrvMsg( pScreen->myNum, X_INFO, "[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n", mode, vendor, device, - pATI->PCIInfo->vendor, - pATI->PCIInfo->chipType ); + pATI->PCIInfo->vendor_id, + pATI->PCIInfo->device_id ); if ( drmAgpEnable( pATI->drmFD, mode ) < 0 ) { xf86DrvMsg( pScreen->myNum, X_ERROR, "[agp] AGP not enabled\n" ); @@ -1134,18 +1134,17 @@ static Bool ATIDRIIrqInit( ScreenPtr pScreen ) if ( pATI->irq <= 0 ) { pATI->irq = drmGetInterruptFromBusID(pATI->drmFD, - ((pciConfigPtr)pATI->PCIInfo - ->thisCard)->busnum, - ((pciConfigPtr)pATI->PCIInfo - ->thisCard)->devnum, - ((pciConfigPtr)pATI->PCIInfo - ->thisCard)->funcnum); + ((pATI->PCIInfo->domain << 8) | + pATI->PCIInfo->bus), + pATI->PCIInfo->dev, + pATI->PCIInfo->func); if ( pATI->irq <= 0 ) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, "[drm] Couldn't find IRQ for bus id %d:%d:%d\n", - ((pciConfigPtr)pATI->PCIInfo->thisCard)->busnum, - ((pciConfigPtr)pATI->PCIInfo->thisCard)->devnum, - ((pciConfigPtr)pATI->PCIInfo->thisCard)->funcnum); + ((pATI->PCIInfo->domain << 8) | + pATI->PCIInfo->bus), + pATI->PCIInfo->dev, + pATI->PCIInfo->func); pATI->irq = 0; } else if ((drmCtlInstHandler(pATI->drmFD, pATI->irq)) != 0) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, @@ -1244,7 +1243,7 @@ Bool ATIDRIScreenInit( ScreenPtr pScreen ) sprintf( pDRIInfo->busIdString, "PCI:%d:%d:%d", pATI->PCIInfo->bus, - pATI->PCIInfo->device, + pATI->PCIInfo->dev, pATI->PCIInfo->func ); } pDRIInfo->ddxDriverMajorVersion = ATI_VERSION_MAJOR; diff --git a/src/atimach64probe.c b/src/atimach64probe.c index 4d7a06a..2c59a5d 100644 --- a/src/atimach64probe.c +++ b/src/atimach64probe.c @@ -33,74 +33,6 @@ #include "atioption.h" #include "ativersion.h" -static SymTabRec -Mach64Chipsets[] = { - {ATI_CHIP_88800GXC, "ATI 88800GX-C"}, - {ATI_CHIP_88800GXD, "ATI 88800GX-D"}, - {ATI_CHIP_88800GXE, "ATI 88800GX-E"}, - {ATI_CHIP_88800GXF, "ATI 88800GX-F"}, - {ATI_CHIP_88800GX, "ATI 88800GX"}, - {ATI_CHIP_88800CX, "ATI 88800CX"}, - {ATI_CHIP_264CT, "ATI 264CT"}, - {ATI_CHIP_264ET, "ATI 264ET"}, - {ATI_CHIP_264VT, "ATI 264VT"}, - {ATI_CHIP_264VTB, "ATI 264VT-B"}, - {ATI_CHIP_264GT, "ATI 3D Rage"}, - {ATI_CHIP_264GTB, "ATI 3D Rage II"}, - {ATI_CHIP_264VT3, "ATI 264VT3"}, - {ATI_CHIP_264GTDVD, "ATI 3D Rage II+DVD"}, - {ATI_CHIP_264LT, "ATI 3D Rage LT"}, - {ATI_CHIP_264VT4, "ATI 264VT4"}, - {ATI_CHIP_264GT2C, "ATI 3D Rage IIc"}, - {ATI_CHIP_264GTPRO, "ATI 3D Rage Pro"}, - {ATI_CHIP_264LTPRO, "ATI 3D Rage LT Pro"}, - {ATI_CHIP_264XL, "ATI 3D Rage XL or XC"}, - {ATI_CHIP_MOBILITY, "ATI 3D Rage Mobility"}, - {-1, NULL } -}; - -/* - * This table maps a PCI device ID to a chipset family identifier. - */ -static PciChipsets -Mach64PciChipsets[] = { - {ATI_CHIP_88800GX, PCI_CHIP_MACH64GX, RES_SHARED_VGA}, - {ATI_CHIP_88800CX, PCI_CHIP_MACH64CX, RES_SHARED_VGA}, - {ATI_CHIP_264CT, PCI_CHIP_MACH64CT, RES_SHARED_VGA}, - {ATI_CHIP_264ET, PCI_CHIP_MACH64ET, RES_SHARED_VGA}, - {ATI_CHIP_264VT, PCI_CHIP_MACH64VT, RES_SHARED_VGA}, - {ATI_CHIP_264GT, PCI_CHIP_MACH64GT, RES_SHARED_VGA}, - {ATI_CHIP_264VT3, PCI_CHIP_MACH64VU, RES_SHARED_VGA}, - {ATI_CHIP_264GTDVD, PCI_CHIP_MACH64GU, RES_SHARED_VGA}, - {ATI_CHIP_264LT, PCI_CHIP_MACH64LG, RES_SHARED_VGA}, - {ATI_CHIP_264VT4, PCI_CHIP_MACH64VV, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GV, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GW, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GY, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GZ, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GB, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GD, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GI, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GP, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GQ, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LB, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LD, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LI, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LP, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LQ, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GL, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GM, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GN, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GO, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GR, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GS, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LM, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LN, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LR, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LS, RES_SHARED_VGA}, - {-1, -1, RES_UNDEFINED} -}; - const OptionInfoRec * Mach64AvailableOptions(int chipid, int busid) { @@ -118,48 +50,20 @@ Mach64AvailableOptions(int chipid, int busid) * do a minimal probe for supported hardware. */ Bool -Mach64Probe(DriverPtr pDriver, int flags) +Mach64PciProbe(DriverPtr pDriver, int entity_num, struct pci_device *dev, + intptr_t match_data) { - GDevPtr *devSections; - int *usedChips; - int numDevSections; - int numUsed; - Bool ProbeSuccess = FALSE; - - if ((numDevSections = xf86MatchDevice(ATI_DRIVER_NAME, &devSections)) <= 0) - return FALSE; - - if (xf86GetPciVideoInfo() == NULL) - return FALSE; - - numUsed = xf86MatchPciInstances(ATI_DRIVER_NAME, PCI_VENDOR_ATI, - Mach64Chipsets, Mach64PciChipsets, - devSections, numDevSections, - pDriver, &usedChips); - xfree(devSections); + ScrnInfoPtr pScrn; - if (numUsed <= 0) + if ((match_data < ATI_CHIP_88800GX) || + (match_data > ATI_CHIP_MOBILITY)) return FALSE; - if (flags & PROBE_DETECT) { - ProbeSuccess = TRUE; - } else { - int i; - - for (i = 0; i < numUsed; i++) { - ScrnInfoPtr pScrn; - EntityInfoPtr pEnt; - pciVideoPtr pVideo; - - pScrn = xf86ConfigPciEntity(NULL, 0, usedChips[i], - NULL, RES_SHARED_VGA, - NULL, NULL, NULL, NULL); + pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL, RES_SHARED_VGA, + NULL, NULL, NULL, NULL); - if (!pScrn) - continue; - - pEnt = xf86GetEntityInfo(usedChips[i]); - pVideo = xf86GetPciInfoForEntity(usedChips[i]); + if (pScrn != NULL) + { #ifdef XFree86LOADER @@ -168,7 +72,7 @@ Mach64Probe(DriverPtr pDriver, int flags) xf86Msg(X_ERROR, ATI_NAME ": Failed to load \"atimisc\" module.\n"); xf86DeleteScreen(pScrn->scrnIndex, 0); - continue; + return FALSE; } xf86LoaderReqSymLists(ATISymbols, NULL); @@ -176,12 +80,7 @@ Mach64Probe(DriverPtr pDriver, int flags) #endif ATIFillInScreenInfo(pScrn); - - pScrn->Probe = Mach64Probe; - - ProbeSuccess = TRUE; - } } - return ProbeSuccess; + return (pScrn != NULL); } diff --git a/src/atimach64probe.h b/src/atimach64probe.h index 4e474ca..dc67308 100644 --- a/src/atimach64probe.h +++ b/src/atimach64probe.h @@ -26,6 +26,7 @@ #include "xf86str.h" extern const OptionInfoRec * Mach64AvailableOptions(int, int); -extern Bool Mach64Probe(DriverPtr, int); +extern Bool Mach64PciProbe(DriverPtr, int, struct pci_device *, + intptr_t); #endif /* ___ATIMACH64PROBE_H___ */ diff --git a/src/atipreinit.c b/src/atipreinit.c index 1fcf212..ab0327d 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -429,12 +429,12 @@ ATIPreInit { if (pATI->CPIODecoding == BLOCK_IO) - pATI->CPIOBase = pVideo->ioBase[1]; + pATI->CPIOBase = pVideo->regions[1].base_addr; /* Set MMIO address from PCI configuration space, if available */ - if ((pATI->Block0Base = pVideo->memBase[2])) + if ((pATI->Block0Base = pVideo->regions[2].base_addr)) { - if (pATI->Block0Base >= (CARD32)(-1 << pVideo->size[2])) + if (pATI->Block0Base >= ~(CARD32)(pVideo->regions[2].size - 1)) pATI->Block0Base = 0; else pATI->Block0Base += 0x0400U; @@ -449,7 +449,7 @@ ATIPreInit if (!pATI->Block0Base) { /* Check tail end of linear (8MB or 4MB) aperture */ - if ((pATI->Block0Base = pVideo->memBase[0])) + if ((pATI->Block0Base = pVideo->regions[0].base_addr)) { pATI->MMIOInLinear = TRUE; diff --git a/src/atiprint.c b/src/atiprint.c index d435e21..349ac25 100644 --- a/src/atiprint.c +++ b/src/atiprint.c @@ -356,7 +356,6 @@ ATIPrintRegisters ) { pciVideoPtr pVideo = pATI->PCIInfo; - pciConfigPtr pPCI = pVideo->thisCard; int Index; CARD32 lcd_index, tv_out_index, lcd_gen_ctrl; CARD8 dac_read, dac_mask, dac_write; @@ -642,10 +641,12 @@ ATIPrintRegisters xf86ErrorFVerb(4, "\n\n PCI configuration register values:"); for (Index = 0; Index < 256; Index+= 4) { + uint32_t data; + pci_device_cfg_read_u32(pVideo, &data, Index); + if (!(Index & 15)) xf86ErrorFVerb(4, "\n 0x%02X: ", Index); - xf86ErrorFVerb(4, " 0x%08lX", - (unsigned long)pciReadLong(pPCI->tag, Index)); + xf86ErrorFVerb(4, " 0x%08X", data); } } diff --git a/src/atiprobe.c b/src/atiprobe.c index 6e8681a..229c470 100644 --- a/src/atiprobe.c +++ b/src/atiprobe.c @@ -215,16 +215,16 @@ ATIMach64Probe const ATIChipType Chip ) { - CARD16 ChipType = pVideo->chipType; + CARD16 ChipType = pVideo->device_id; /* * Probe through auxiliary MMIO aperture if one exists. Because such * apertures can be enabled/disabled only through PCI, this probes no * further. */ - if ((pVideo->size[2] >= 12) && - (pATI->Block0Base = pVideo->memBase[2]) && - (pATI->Block0Base < (CARD32)(-1 << pVideo->size[2]))) + if ((pVideo->regions[2].size >= (1 << 12)) && + (pATI->Block0Base = pVideo->regions[2].base_addr) && + (pATI->Block0Base < ~(CARD32)(pVideo->regions[2].size - 1))) { pATI->Block0Base += 0x00000400U; goto LastProbe; @@ -234,13 +234,13 @@ ATIMach64Probe * Probe through the primary MMIO aperture that exists at the tail end * of the linear aperture. Test for both 8MB and 4MB linear apertures. */ - if ((pVideo->size[0] >= 22) && - (pATI->Block0Base = pVideo->memBase[0])) + if ((pVideo->regions[0].size >= (1 << 22)) && + (pATI->Block0Base = pVideo->regions[0].base_addr)) { pATI->MMIOInLinear = TRUE; pATI->Block0Base += 0x007FFC00U; - if ((pVideo->size[0] >= 23) && + if ((pVideo->regions[0].size >= (1 << 23)) && ATIMach64Detect(pATI, ChipType, Chip)) return pATI; @@ -273,11 +273,11 @@ ATIMach64Probe ) { CARD32 IOValue; - CARD16 ChipType = pVideo->chipType; + CARD16 ChipType = pVideo->device_id; if ((pATI->CPIODecoding == BLOCK_IO) && - ((pVideo->size[1] < 8) || - (pATI->CPIOBase >= (CARD32)(-1 << pVideo->size[1])))) + ((pVideo->regions[1].size < (1 << 8)) || + (pATI->CPIOBase >= ~(CARD32)(pVideo->regions[1].size - 1)))) return NULL; if (!ATIMach64Detect(pATI, ChipType, Chip)) @@ -377,21 +377,17 @@ ATIMach64ProbeIO #ifndef AVOID_CPIO /* Next, look for sparse I/O Mach64's */ - if (!pVideo->size[1]) + if (!pVideo->regions[1].size) { static const IOADDRESS Mach64SparseIOBases[] = { 0x02ECU, 0x01CCU, 0x01C8U }; - pciConfigPtr pPCI = pVideo->thisCard; - CARD32 PciReg; - CARD32 j; + uint32_t PciReg; + CARD32 j; - if (pPCI == NULL) - goto SkipSparse; - - PciReg = pciReadLong(pPCI->tag, PCI_REG_USERCONFIG); + pci_device_cfg_read_u32(pVideo, &PciReg, PCI_REG_USERCONFIG); j = PciReg & 0x03U; if (j == 0x03U) @@ -399,7 +395,7 @@ ATIMach64ProbeIO xf86Msg(X_WARNING, ATI_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", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->bus, pVideo->dev, pVideo->func); goto SkipSparse; } @@ -419,14 +415,17 @@ ATIMach64ProbeIO xf86Msg(X_WARNING, ATI_NAME ": " "PCI Mach64 in slot %d:%d:%d will not be probed\n" "set option \"probe_sparse\" to force sparse I/O probing.\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->bus, pVideo->dev, pVideo->func); goto SkipSparse; } /* Possibly fix block I/O indicator */ if (PciReg & 0x00000004U) - pciWriteLong(pPCI->tag, PCI_REG_USERCONFIG, PciReg & ~0x00000004U); + { + PciReg &= ~0x00000004U; + pci_device_cfg_write_u32(pVideo, PciReg, PCI_REG_USERCONFIG); + } pATI->CPIOBase = Mach64SparseIOBases[j]; pATI->CPIODecoding = SPARSE_IO; @@ -436,7 +435,7 @@ ATIMach64ProbeIO { xf86Msg(X_WARNING, ATI_NAME ": " "PCI Mach64 in slot %d:%d:%d could not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->bus, pVideo->dev, pVideo->func); } else { @@ -444,7 +443,7 @@ ATIMach64ProbeIO xf86Msg(X_INFO, ATI_NAME ": " "Shared PCI Mach64 in slot %d:%d:%d with sparse PIO base" " 0x%04lX detected.\n", - pVideo->bus, pVideo->device, pVideo->func, + pVideo->bus, pVideo->dev, pVideo->func, Mach64SparseIOBases[j]); if (pATI->VGAAdapter) @@ -456,7 +455,7 @@ SkipSparse: #else /* AVOID_CPIO */ - if (!pVideo->size[1]) + if (!pVideo->regions[1].size) { /* The adapter's CPIO base is of little concern here */ pATI->CPIOBase = 0; @@ -469,23 +468,23 @@ SkipSparse: xf86Msg(X_INFO, ATI_NAME ": " "Shared PCI Mach64 in slot %d:%d:%d with Block 0 base" " 0x%08lX detected.\n", - pVideo->bus, pVideo->device, pVideo->func, + pVideo->bus, pVideo->dev, pVideo->func, pATI->Block0Base); } else { xf86Msg(X_WARNING, ATI_NAME ": " "PCI Mach64 in slot %d:%d:%d could not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->bus, pVideo->dev, pVideo->func); } } #endif /* AVOID_CPIO */ /* Lastly, look for block I/O devices */ - if (pVideo->size[1]) + if (pVideo->regions[1].size) { - pATI->CPIOBase = pVideo->ioBase[1]; + pATI->CPIOBase = pVideo->regions[1].base_addr; pATI->CPIODecoding = BLOCK_IO; pATI->PCIInfo = pVideo; @@ -494,7 +493,7 @@ SkipSparse: ProbeSuccess = TRUE; xf86Msg(X_INFO, ATI_NAME ": " "Shared PCI/AGP Mach64 in slot %d:%d:%d detected.\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->bus, pVideo->dev, pVideo->func); #ifndef AVOID_CPIO @@ -508,7 +507,7 @@ SkipSparse: { xf86Msg(X_WARNING, ATI_NAME ": " "PCI/AGP Mach64 in slot %d:%d:%d could not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->bus, pVideo->dev, pVideo->func); } } diff --git a/src/atistruct.h b/src/atistruct.h index 597ebd9..8fa493c 100644 --- a/src/atistruct.h +++ b/src/atistruct.h @@ -57,6 +57,7 @@ #ifdef USE_XAA #include "xaa.h" #endif +#include #include "xf86Cursor.h" #include "xf86Pci.h" #include "xf86Resources.h" @@ -209,6 +210,8 @@ typedef struct _Mach64ContextRegs3D #endif /* USE_EXA */ +typedef struct pci_device *pciVideoPtr; + /* * This structure defines the driver's private area. */ diff --git a/src/atividmem.c b/src/atividmem.c index 2a7c9c1..a8c4c4e 100644 --- a/src/atividmem.c +++ b/src/atividmem.c @@ -106,7 +106,7 @@ ATIUnmapLinear pciVideoPtr pVideo = pATI->PCIInfo; if (pATI->pMemoryLE) - xf86UnMapVidMem(iScreen, pATI->pMemoryLE, (1U << pVideo->size[0])); + pci_device_unmap_region(pVideo, 0); pATI->pMemory = pATI->pMemoryLE = NULL; @@ -125,8 +125,10 @@ ATIUnmapMMIO ATIPtr pATI ) { + pciVideoPtr pVideo = pATI->PCIInfo; + if (pATI->pMMIO) - xf86UnMapVidMem(iScreen, pATI->pMMIO, getpagesize()); + pci_device_unmap_region(pVideo, 2); pATI->pMMIO = pATI->pBlock[0] = pATI->pBlock[1] = NULL; } @@ -149,8 +151,7 @@ ATIMapApertures ) { pciVideoPtr pVideo = pATI->PCIInfo; - PCITAG Tag = ((pciConfigPtr)(pVideo->thisCard))->tag; - int mode; + int err; if (pATI->Mapped) return TRUE; @@ -165,7 +166,7 @@ ATIMapApertures * aperture is supported. Hence, the hard-coded values here... */ pATI->pBank = xf86MapDomainMemory(iScreen, VIDMEM_MMIO_32BIT, - Tag, 0x000A0000U, 0x00010000U); + pVideo, 0x000A0000U, 0x00010000U); if (!pATI->pBank) return FALSE; @@ -177,19 +178,9 @@ ATIMapApertures /* Map linear aperture */ { - mode = VIDMEM_FRAMEBUFFER; - - /* Reset write-combining for the whole FB when MMIO registers fall in - * the linear aperture. - */ - if (pATI->MMIOInLinear) - mode = VIDMEM_MMIO; + err = pci_device_map_region(pVideo, 0, TRUE); - pATI->pMemoryLE = xf86MapPciMem(iScreen, mode, Tag, - pVideo->memBase[0], - (1U << pVideo->size[0])); - - if (!pATI->pMemoryLE) + if (err) { #ifndef AVOID_CPIO @@ -202,6 +193,8 @@ ATIMapApertures return FALSE; } + pATI->pMemoryLE = pVideo->regions[0].memory; + pATI->Mapped = TRUE; #if X_BYTE_ORDER == X_LITTLE_ENDIAN @@ -227,12 +220,9 @@ ATIMapApertures /* Map MMIO aperture */ if (pATI->Block0Base && !pATI->MMIOInLinear) { - mode = VIDMEM_MMIO; - pATI->pMMIO = xf86MapPciMem(iScreen, mode, Tag, - pVideo->memBase[2], - getpagesize()); + err = pci_device_map_region(pVideo, 2, TRUE); - if (!pATI->pMMIO) + if (err) { ATIUnmapLinear(iScreen, pATI); @@ -246,6 +236,8 @@ ATIMapApertures return FALSE; } + pATI->pMMIO = pVideo->regions[2].memory; + pATI->Mapped = TRUE; pATI->pBlock[0] = (char *)pATI->pMMIO + 0x00000400U; @@ -255,7 +247,7 @@ ATIMapApertures } else if (pATI->Block0Base) { - CARD32 Block0Offset = pATI->Block0Base - pVideo->memBase[0]; + CARD32 Block0Offset = pATI->Block0Base - pVideo->regions[0].base_addr; pATI->pMMIO = NULL; @@ -263,7 +255,7 @@ ATIMapApertures * assumes that old mach64 cards with a 4MB linear aperture do not have * an extended BE aperture which would give a size of 8MB. */ - if (Block0Offset + 0x00000400U >= (1 << pVideo->size[0])) + if (Block0Offset + 0x00000400U >= pVideo->regions[0].size) { ATIUnmapLinear(iScreen, pATI); diff --git a/src/r128_probe.c b/src/r128_probe.c index 96e7897..311ddd9 100644 --- a/src/r128_probe.c +++ b/src/r128_probe.c @@ -135,6 +135,7 @@ R128Identify(int flags) } /* Return TRUE if chipset is present; FALSE otherwise. */ +#if 0 Bool R128Probe(DriverPtr drv, int flags) { @@ -256,3 +257,11 @@ R128Probe(DriverPtr drv, int flags) return foundScreen; } +#else +Bool +R128PciProbe(DriverPtr pDriver, int entity_num, struct pci_device *dev, + intptr_t match_data) +{ + return FALSE; +} +#endif diff --git a/src/r128_probe.h b/src/r128_probe.h index 9150296..285ccae 100644 --- a/src/r128_probe.h +++ b/src/r128_probe.h @@ -56,7 +56,12 @@ typedef struct /* r128_probe.c */ extern const OptionInfoRec * R128AvailableOptions(int, int); extern void R128Identify(int); +#if 0 extern Bool R128Probe(DriverPtr, int); +#else +extern Bool R128PciProbe(DriverPtr, int, struct pci_device *, + intptr_t); +#endif extern PciChipsets R128PciChipsets[]; diff --git a/src/radeon_probe.c b/src/radeon_probe.c index 98b35aa..4dbdae7 100644 --- a/src/radeon_probe.c +++ b/src/radeon_probe.c @@ -228,6 +228,7 @@ RADEONIdentify(int flags) } /* Return TRUE if chipset is present; FALSE otherwise. */ +#if 0 Bool RADEONProbe(DriverPtr drv, int flags) { @@ -343,3 +344,11 @@ RADEONProbe(DriverPtr drv, int flags) return foundScreen; } +#else +Bool +RADEONPciProbe(DriverPtr pDriver, int entity_num, struct pci_device *dev, + intptr_t match_data) +{ + return FALSE; +} +#endif diff --git a/src/radeon_probe.h b/src/radeon_probe.h index b651e7d..a905ded 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -151,7 +151,12 @@ typedef struct /* radeon_probe.c */ extern const OptionInfoRec *RADEONAvailableOptions(int, int); extern void RADEONIdentify(int); +#if 0 extern Bool RADEONProbe(DriverPtr, int); +#else +extern Bool RADEONPciProbe(DriverPtr, int, struct pci_device *, + intptr_t); +#endif extern PciChipsets RADEONPciChipsets[];