diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 5 | ||||
-rw-r--r-- | src/ati.c | 593 | ||||
-rw-r--r-- | src/ati.h | 72 | ||||
-rw-r--r-- | src/atichip.h | 30 | ||||
-rw-r--r-- | src/aticonsole.c | 9 | ||||
-rw-r--r-- | src/atii2c.c | 3 | ||||
-rw-r--r-- | src/atiload.c | 173 | ||||
-rw-r--r-- | src/atiload.h | 37 | ||||
-rw-r--r-- | src/atimisc.c | 43 | ||||
-rw-r--r-- | src/atimode.c | 9 | ||||
-rw-r--r-- | src/atimodule.c | 35 | ||||
-rw-r--r-- | src/atimodule.h | 30 | ||||
-rw-r--r-- | src/atipreinit.c | 6 | ||||
-rw-r--r-- | src/r128.h | 6 | ||||
-rw-r--r-- | src/r128_cursor.c | 2 | ||||
-rw-r--r-- | src/r128_dri.c | 16 | ||||
-rw-r--r-- | src/r128_driver.c | 275 | ||||
-rw-r--r-- | src/r128_misc.c | 6 | ||||
-rw-r--r-- | src/r128_probe.h | 1 | ||||
-rw-r--r-- | src/r128_video.c | 8 | ||||
-rw-r--r-- | src/radeon.h | 2 | ||||
-rw-r--r-- | src/radeon_accelfuncs.c | 10 | ||||
-rw-r--r-- | src/radeon_driver.c | 216 | ||||
-rw-r--r-- | src/radeon_exa_funcs.c | 1 | ||||
-rw-r--r-- | src/radeon_misc.c | 6 | ||||
-rw-r--r-- | src/radeon_mm_i2c.c | 14 | ||||
-rw-r--r-- | src/radeon_probe.h | 1 | ||||
-rw-r--r-- | src/radeon_video.c | 3 | ||||
-rw-r--r-- | src/theatre.h | 38 | ||||
-rw-r--r-- | src/theatre_detect.h | 11 |
30 files changed, 241 insertions, 1420 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 5e95dd7c..0f96e1c5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -99,16 +99,12 @@ atimisc_drv_la_SOURCES = \ atiload.c atimisc.c atimach64probe.c $(ATIMISC_CPIO_SOURCES) \ $(ATIMISC_DGA_SOURCES) $(ATIMISC_DRI_SRCS) $(ATIMISC_EXA_SOURCES) -if XSERVER_LIBPCIACCESS -# r128 has not been ported yet -else r128_drv_la_LTLIBRARIES = r128_drv.la r128_drv_la_LDFLAGS = -module -avoid-version r128_drv_ladir = @moduledir@/drivers r128_drv_la_SOURCES = \ r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \ r128_video.c r128_misc.c r128_probe.c $(R128_DRI_SRCS) -endif radeon_drv_la_LTLIBRARIES = radeon_drv.la radeon_drv_la_LDFLAGS = -module -avoid-version @@ -179,7 +175,6 @@ EXTRA_DIST = \ atimach64io.h \ atimach64probe.h \ atimode.h \ - atimodule.h \ atioption.h \ atipreinit.h \ atiprint.h \ @@ -63,13 +63,22 @@ #include "atipcirename.h" #include "ati.h" -#include "atimodule.h" #include "ativersion.h" -#include "atimach64probe.h" +#include "atimach64probe.h" #include "radeon_probe.h" #include "r128_probe.h" +enum +{ + ATI_CHIP_FAMILY_NONE = 0, + ATI_CHIP_FAMILY_Mach64, + ATI_CHIP_FAMILY_Rage128, + ATI_CHIP_FAMILY_Radeon +}; + +static int ATIChipID(const CARD16); + #ifdef XSERVER_LIBPCIACCESS static const struct pci_id_match ati_device_match = { PCI_VENDOR_ATI, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0 @@ -127,7 +136,7 @@ ATIProbe #endif Bool DoMach64 = FALSE; Bool DoRage128 = FALSE, DoRadeon = FALSE; - ATIChipType Chip; + int Chip; #ifndef XSERVER_LIBPCIACCESS @@ -143,12 +152,12 @@ ATIProbe continue; /* Check for Rage128's, Radeon's and later adapters */ - Chip = ATIChipID(PCI_DEV_DEVICE_ID(pVideo), PCI_DEV_REVISION(pVideo)); - if (Chip <= ATI_CHIP_Mach64) + Chip = ATIChipID(PCI_DEV_DEVICE_ID(pVideo)); + if (Chip == ATI_CHIP_FAMILY_Mach64) DoMach64 = TRUE; - else if (Chip <= ATI_CHIP_Rage128) + else if (Chip == ATI_CHIP_FAMILY_Rage128) DoRage128 = TRUE; - else if (Chip <= ATI_CHIP_Radeon) + else if (Chip == ATI_CHIP_FAMILY_Radeon) DoRadeon = TRUE; } @@ -168,12 +177,12 @@ ATIProbe continue; /* Check for Rage128's, Radeon's and later adapters */ - Chip = ATIChipID(PCI_DEV_DEVICE_ID(pVideo), PCI_DEV_REVISION(pVideo)); - if (Chip <= ATI_CHIP_Mach64) + Chip = ATIChipID(PCI_DEV_DEVICE_ID(pVideo)); + if (Chip == ATI_CHIP_FAMILY_Mach64) DoMach64 = TRUE; - else if (Chip <= ATI_CHIP_Rage128) + else if (Chip == ATI_CHIP_FAMILY_Rage128) DoRage128 = TRUE; - else if (Chip <= ATI_CHIP_Radeon) + else if (Chip == ATI_CHIP_FAMILY_Radeon) DoRadeon = TRUE; } @@ -193,8 +202,6 @@ ATIProbe return FALSE; } - xf86LoaderReqSymLists(RADEONSymbols, NULL); - RADEONIdentify(flags); if (RADEONProbe(pDriver, flags)) @@ -215,8 +222,6 @@ ATIProbe return FALSE; } - xf86LoaderReqSymLists(R128Symbols, NULL); - R128Identify(flags); if (R128Probe(pDriver, flags)) @@ -237,8 +242,6 @@ ATIProbe return FALSE; } - xf86LoaderReqSymLists(ATISymbols, NULL); - Mach64Identify(flags); if (Mach64Probe(pDriver, flags)) @@ -263,16 +266,16 @@ ATIAvailableOptions ) { CARD16 ChipType = ChipId & 0xffff; - ATIChipType Chip; + int Chip; /* Probe should have loaded the appropriate subdriver by this point */ - Chip = ATIChipID(ChipType, 0x0); /* chip revision is don't care */ - if (Chip <= ATI_CHIP_Mach64) + Chip = ATIChipID(ChipType); + if (Chip == ATI_CHIP_FAMILY_Mach64) return Mach64AvailableOptions(ChipId, BusId); - else if (Chip <= ATI_CHIP_Rage128) + else if (Chip == ATI_CHIP_FAMILY_Rage128) return R128AvailableOptions(ChipId, BusId); - else if (Chip <= ATI_CHIP_Radeon) + else if (Chip == ATI_CHIP_FAMILY_Radeon) return RADEONAvailableOptions(ChipId, BusId); return NULL; @@ -291,467 +294,105 @@ _X_EXPORT DriverRec ATI = }; /* - * Chip-related definitions. - */ -const char *ATIChipNames[] = -{ - "Unknown", - "ATI 88800GX-C", - "ATI 88800GX-D", - "ATI 88800GX-E", - "ATI 88800GX-F", - "ATI 88800GX", - "ATI 88800CX", - "ATI 264CT", - "ATI 264ET", - "ATI 264VT", - "ATI 3D Rage", - "ATI 264VT-B", - "ATI 3D Rage II", - "ATI 264VT3", - "ATI 3D Rage II+DVD", - "ATI 3D Rage LT", - "ATI 264VT4", - "ATI 3D Rage IIc", - "ATI 3D Rage Pro", - "ATI 3D Rage LT Pro", - "ATI 3D Rage XL or XC", - "ATI 3D Rage Mobility", - "ATI unknown Mach64", - "ATI Rage 128 GL", - "ATI Rage 128 VR", - "ATI Rage 128 Pro GL", - "ATI Rage 128 Pro VR", - "ATI Rage 128 Pro ULTRA", - "ATI Rage 128 Mobility M3", - "ATI Rage 128 Mobility M4", - "ATI unknown Rage 128" - "ATI Radeon 7200", - "ATI Radeon 7000 (VE)", - "ATI Radeon Mobility M6", - "ATI Radeon IGP320", - "ATI Radeon IGP330/340/350", - "ATI Radeon 7000 IGP", - "ATI Radeon 7500", - "ATI Radeon Mobility M7", - "ATI Radeon 8500/9100", - "ATI Radeon 9000", - "ATI Radeon Mobility M9", - "ATI Radeon 9100 IGP", - "ATI Radeon 9200 IGP", - "ATI Radeon 9200", - "ATI Radeon Mobility M9+", - "ATI Radeon 9700/9500", - "ATI Radeon 9600/9550", - "ATI Radeon 9800", - "ATI Radeon 9800XT", - "ATI Radeon X300/X550/M22", - "ATI Radeon X600/X550/M24", - "ATI Radeon X800/M18 AGP", - "ATI Radeon X800/M28 PCIE", - "ATI Radeon X800XL PCIE", - "ATI Radeon X850 PCIE", - "ATI Radeon X850 AGP", - "ATI Radeon X700", - "ATI Xpress 200" - "ATI unknown Radeon", - "ATI Rage HDTV" -}; - -#include "atichip.h" - -/* * ATIChipID -- * - * This returns the ATI_CHIP_* value (generally) associated with a particular - * ChipID/ChipRev combination. + * This returns the ATI_CHIP_FAMILY_* value associated with a particular ChipID. */ -ATIChipType -ATIChipID -( - const CARD16 ChipID, - const CARD8 ChipRev -) +static int +ATIChipID(const CARD16 ChipID) { 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. <mharris@redhat.com> - */ - 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; + case PCI_CHIP_MACH64GX: + case PCI_CHIP_MACH64CX: + case PCI_CHIP_MACH64CT: + case PCI_CHIP_MACH64ET: + case PCI_CHIP_MACH64VT: + case PCI_CHIP_MACH64GT: + case PCI_CHIP_MACH64VU: + case PCI_CHIP_MACH64GU: + case PCI_CHIP_MACH64LG: + case PCI_CHIP_MACH64VV: + case PCI_CHIP_MACH64GV: + case PCI_CHIP_MACH64GW: + case PCI_CHIP_MACH64GY: + case PCI_CHIP_MACH64GZ: + case PCI_CHIP_MACH64GB: + case PCI_CHIP_MACH64GD: + case PCI_CHIP_MACH64GI: + case PCI_CHIP_MACH64GP: + case PCI_CHIP_MACH64GQ: + case PCI_CHIP_MACH64LB: + case PCI_CHIP_MACH64LD: + case PCI_CHIP_MACH64LI: + case PCI_CHIP_MACH64LP: + case PCI_CHIP_MACH64LQ: + case PCI_CHIP_MACH64GL: + case PCI_CHIP_MACH64GM: + case PCI_CHIP_MACH64GN: + case PCI_CHIP_MACH64GO: + case PCI_CHIP_MACH64GR: + case PCI_CHIP_MACH64GS: + case PCI_CHIP_MACH64LM: + case PCI_CHIP_MACH64LN: + case PCI_CHIP_MACH64LR: + case PCI_CHIP_MACH64LS: + return ATI_CHIP_FAMILY_Mach64; + + case PCI_CHIP_RAGE128RE: + case PCI_CHIP_RAGE128RF: + case PCI_CHIP_RAGE128RG: + case PCI_CHIP_RAGE128SK: + case PCI_CHIP_RAGE128SL: + case PCI_CHIP_RAGE128SM: + case PCI_CHIP_RAGE128SN: + case PCI_CHIP_RAGE128RK: + case PCI_CHIP_RAGE128RL: + case PCI_CHIP_RAGE128SE: + case PCI_CHIP_RAGE128SF: + case PCI_CHIP_RAGE128SG: + case PCI_CHIP_RAGE128SH: + case PCI_CHIP_RAGE128PA: + case PCI_CHIP_RAGE128PB: + case PCI_CHIP_RAGE128PC: + case PCI_CHIP_RAGE128PD: + case PCI_CHIP_RAGE128PE: + case PCI_CHIP_RAGE128PF: + case PCI_CHIP_RAGE128PG: + case PCI_CHIP_RAGE128PH: + case PCI_CHIP_RAGE128PI: + case PCI_CHIP_RAGE128PJ: + case PCI_CHIP_RAGE128PK: + case PCI_CHIP_RAGE128PL: + case PCI_CHIP_RAGE128PM: + case PCI_CHIP_RAGE128PN: + case PCI_CHIP_RAGE128PO: + case PCI_CHIP_RAGE128PP: + case PCI_CHIP_RAGE128PQ: + case PCI_CHIP_RAGE128PR: + case PCI_CHIP_RAGE128PS: + case PCI_CHIP_RAGE128PT: + case PCI_CHIP_RAGE128PU: + case PCI_CHIP_RAGE128PV: + case PCI_CHIP_RAGE128PW: + case PCI_CHIP_RAGE128PX: + case PCI_CHIP_RAGE128TF: + case PCI_CHIP_RAGE128TL: + case PCI_CHIP_RAGE128TR: + case PCI_CHIP_RAGE128TS: + case PCI_CHIP_RAGE128TT: + case PCI_CHIP_RAGE128TU: + case PCI_CHIP_RAGE128LE: + case PCI_CHIP_RAGE128LF: +#if 0 + case PCI_CHIP_RAGE128LK: + case PCI_CHIP_RAGE128LL: +#endif + case PCI_CHIP_RAGE128MF: + case PCI_CHIP_RAGE128ML: + return ATI_CHIP_FAMILY_Rage128; 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; + return ATI_CHIP_FAMILY_Radeon; } } @@ -33,76 +33,4 @@ extern DriverRec ATI; -/* - * Chip-related definitions. - */ -typedef enum -{ - ATI_CHIP_NONE = 0, - ATI_CHIP_88800GXC, /* Mach64 */ - ATI_CHIP_88800GXD, /* Mach64 */ - ATI_CHIP_88800GXE, /* Mach64 */ - ATI_CHIP_88800GXF, /* Mach64 */ - ATI_CHIP_88800GX, /* Mach64 */ - ATI_CHIP_88800CX, /* Mach64 */ - ATI_CHIP_264CT, /* Mach64 */ - ATI_CHIP_264ET, /* Mach64 */ - ATI_CHIP_264VT, /* Mach64 */ - ATI_CHIP_264GT, /* Mach64 */ - ATI_CHIP_264VTB, /* Mach64 */ - ATI_CHIP_264GTB, /* Mach64 */ - ATI_CHIP_264VT3, /* Mach64 */ - ATI_CHIP_264GTDVD, /* Mach64 */ - ATI_CHIP_264LT, /* Mach64 */ - ATI_CHIP_264VT4, /* Mach64 */ - ATI_CHIP_264GT2C, /* Mach64 */ - ATI_CHIP_264GTPRO, /* Mach64 */ - ATI_CHIP_264LTPRO, /* Mach64 */ - ATI_CHIP_264XL, /* Mach64 */ - ATI_CHIP_MOBILITY, /* Mach64 */ - ATI_CHIP_Mach64, /* Last among Mach64's */ - ATI_CHIP_RAGE128GL, /* Rage128 */ - ATI_CHIP_RAGE128VR, /* Rage128 */ - ATI_CHIP_RAGE128PROGL, /* Rage128 */ - ATI_CHIP_RAGE128PROVR, /* Rage128 */ - ATI_CHIP_RAGE128PROULTRA, /* Rage128 */ - ATI_CHIP_RAGE128MOBILITY3, /* Rage128 */ - ATI_CHIP_RAGE128MOBILITY4, /* Rage128 */ - ATI_CHIP_Rage128, /* Last among Rage128's */ - ATI_CHIP_RADEON, /* Radeon */ - ATI_CHIP_RADEONVE, /* Radeon VE */ - ATI_CHIP_RADEONMOBILITY6, /* Radeon M6 */ - ATI_CHIP_RS100, /* IGP320 */ - ATI_CHIP_RS200, /* IGP340 */ - ATI_CHIP_RS250, /* Radoen 7000 IGP */ - ATI_CHIP_RV200, /* RV200 */ - ATI_CHIP_RADEONMOBILITY7, /* Radeon M7 */ - ATI_CHIP_R200, /* R200 */ - ATI_CHIP_RV250, /* RV250 */ - ATI_CHIP_RADEONMOBILITY9, /* Radeon M9 */ - ATI_CHIP_RS300, /* Radoen 9100 IGP */ - ATI_CHIP_RS350, /* Radoen 9200 IGP */ - ATI_CHIP_RV280, /* RV250 */ - ATI_CHIP_RADEONMOBILITY9PLUS, /* Radeon M9+ */ - ATI_CHIP_R300, /* R300 */ - ATI_CHIP_RV350, /* RV350/M10/M11 */ - ATI_CHIP_R350, /* R350 */ - ATI_CHIP_R360, /* R360 */ - ATI_CHIP_RV370, /* RV370/M22 */ - ATI_CHIP_RV380, /* RV380/M24 */ - ATI_CHIP_R420, /* R420/M18 */ - ATI_CHIP_R423, /* R423/M28? */ - ATI_CHIP_R430, /* R430 */ - ATI_CHIP_R480, /* R480/M28? */ - ATI_CHIP_R481, /* R481 */ - ATI_CHIP_RV410, /* RV410, M26 */ - ATI_CHIP_RS400, /* RS400, RS410, RS480, RS482, ... */ - ATI_CHIP_Radeon, /* Last among Radeon's */ - ATI_CHIP_HDTV /* HDTV */ -} ATIChipType; - -extern const char *ATIChipNames[]; - -extern ATIChipType ATIChipID(const CARD16, const CARD8); - #endif /* ___ATI_H___ */ diff --git a/src/atichip.h b/src/atichip.h index 44cd1888..e59d6ebb 100644 --- a/src/atichip.h +++ b/src/atichip.h @@ -29,6 +29,36 @@ #include <X11/Xmd.h> /* + * Chip-related definitions. + */ +typedef enum +{ + ATI_CHIP_NONE = 0, + ATI_CHIP_88800GXC, /* Mach64 */ + ATI_CHIP_88800GXD, /* Mach64 */ + ATI_CHIP_88800GXE, /* Mach64 */ + ATI_CHIP_88800GXF, /* Mach64 */ + ATI_CHIP_88800GX, /* Mach64 */ + ATI_CHIP_88800CX, /* Mach64 */ + ATI_CHIP_264CT, /* Mach64 */ + ATI_CHIP_264ET, /* Mach64 */ + ATI_CHIP_264VT, /* Mach64 */ + ATI_CHIP_264GT, /* Mach64 */ + ATI_CHIP_264VTB, /* Mach64 */ + ATI_CHIP_264GTB, /* Mach64 */ + ATI_CHIP_264VT3, /* Mach64 */ + ATI_CHIP_264GTDVD, /* Mach64 */ + ATI_CHIP_264LT, /* Mach64 */ + ATI_CHIP_264VT4, /* Mach64 */ + ATI_CHIP_264GT2C, /* Mach64 */ + ATI_CHIP_264GTPRO, /* Mach64 */ + ATI_CHIP_264LTPRO, /* Mach64 */ + ATI_CHIP_264XL, /* Mach64 */ + ATI_CHIP_MOBILITY, /* Mach64 */ + ATI_CHIP_Mach64, /* Last among Mach64's */ +} ATIChipType; + +/* * Foundry codes for 264xT's. */ typedef enum diff --git a/src/aticonsole.c b/src/aticonsole.c index bd5ec9c5..f8f20329 100644 --- a/src/aticonsole.c +++ b/src/aticonsole.c @@ -51,11 +51,6 @@ #include "atioption.h" #include "vbe.h" -static const char *vbeSymbols[] = { - "VBEGetVBEMode", - NULL -}; - #endif /* TV_OUT */ /* @@ -131,8 +126,6 @@ ATIProbeAndSetActiveDisplays int disp_request; ATITVStandard tv_std, tv_std_request; - xf86LoaderRefSymLists(vbeSymbols, NULL); - if (xf86GetVerbosity() > 3) { xf86ErrorFVerb(4, "\n Before TV-Out queries\n\n"); ATIPrintRegisters(pATI); @@ -539,8 +532,6 @@ ATIEnterGraphics #ifdef TV_OUT if (pATI->OptionTvOut) { - xf86LoaderRefSymLists(vbeSymbols, NULL); - if (pATI->pVBE) { if (VBEGetVBEMode(pATI->pVBE, &pATI->vbemode)) { xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Saving VESA mode: 0x%x\n", diff --git a/src/atii2c.c b/src/atii2c.c index 73febf7a..a13d6477 100644 --- a/src/atii2c.c +++ b/src/atii2c.c @@ -25,7 +25,6 @@ #endif #include "atii2c.h" -#include "atiload.h" #include "atimach64i2c.h" #include "atistruct.h" @@ -365,7 +364,7 @@ ATII2CPreInit ATIPtr pATI ) { - if (!ATILoadModule(pScreenInfo, "i2c", ATIi2cSymbols)) + if (!xf86LoadSubModule(pScreenInfo, "i2c")) return; ATIMach64I2CPreInit(pScreenInfo, pATI); diff --git a/src/atiload.c b/src/atiload.c index 0001ced9..621b0b07 100644 --- a/src/atiload.c +++ b/src/atiload.c @@ -18,179 +18,18 @@ * 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. - * - * DRI support by: - * Leif Delgass <ldelgass@retinalburn.net> */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef XFree86LOADER - #include "ati.h" #include "aticursor.h" #include "atiload.h" #include "atistruct.h" /* - * All symbol lists belong here. They are externalised so that they can be - * referenced elsewhere. Note the naming convention for these things... - */ - -const char *ATIint10Symbols[] = -{ - "xf86FreeInt10", - "xf86InitInt10", - "xf86int10Addr", - NULL -}; - -const char *ATIddcSymbols[] = -{ - "xf86PrintEDID", - "xf86SetDDCproperties", - NULL -}; - -const char *ATIvbeSymbols[] = -{ - "VBEInit", - "vbeDoEDID", - "vbeFree", - NULL -}; - -#ifdef XF86DRI_DEVEL - -const char *ATIdrmSymbols[] = { - "drmAddBufs", - "drmAddMap", - "drmAgpAcquire", - "drmAgpAlloc", - "drmAgpBase", - "drmAgpBind", - "drmAgpDeviceId", - "drmAgpEnable", - "drmAgpFree", - "drmAgpGetMode", - "drmAgpRelease", - "drmAgpUnbind", - "drmAgpVendorId", - "drmAvailable", - "drmCommandNone", - "drmCommandRead", - "drmCommandWrite", - "drmCommandWriteRead", - "drmCtlInstHandler", - "drmCtlUninstHandler", - "drmFreeVersion", - "drmGetInterruptFromBusID", - "drmGetLibVersion", - "drmGetVersion", - "drmMap", - "drmMapBufs", - "drmDMA", - "drmUnmap", - "drmUnmapBufs", - NULL -}; - -const char *ATIdriSymbols[] = { - "DRICloseScreen", - "DRICreateInfoRec", - "DRIDestroyInfoRec", - "DRIFinishScreenInit", - "DRIGetSAREAPrivate", - "DRILock", - "DRIQueryVersion", - "DRIScreenInit", - "DRIUnlock", - "GlxSetVisualConfigs", - "DRICreatePCIBusID", - NULL -}; - -#endif /* XF86DRI_DEVEL */ - -const char *ATIfbSymbols[] = -{ - "fbPictureInit", - "fbScreenInit", - NULL -}; - -const char *ATIshadowfbSymbols[] = -{ - "ShadowFBInit", - NULL -}; - -#ifdef USE_EXA -const char *ATIexaSymbols[] = -{ - "exaDriverAlloc", - "exaDriverInit", - "exaDriverFini", - "exaOffscreenAlloc", - "exaOffscreenFree", - NULL -}; -#endif - -#ifdef USE_XAA -const char *ATIxaaSymbols[] = -{ - "XAACreateInfoRec", - "XAADestroyInfoRec", - "XAAInit", - NULL -}; -#endif - -const char *ATIramdacSymbols[] = -{ - "xf86CreateCursorInfoRec", - "xf86DestroyCursorInfoRec", - "xf86InitCursor", - NULL -}; - -const char *ATIi2cSymbols[] = -{ - "xf86CreateI2CBusRec", - "xf86DestroyI2CBusRec", - "xf86I2CBusInit", - "xf86I2CDevInit", - "xf86I2CFindDev", - "xf86I2CGetScreenBuses", - NULL -}; - -/* - * ATILoadModule -- - * - * Load a specific module and register with the loader those of its entry - * points that are referenced by this driver. - */ -pointer -ATILoadModule -( - ScrnInfoPtr pScreenInfo, - const char *Module, - const char **SymbolList -) -{ - pointer pModule = xf86LoadSubModule(pScreenInfo, Module); - - if (pModule) - xf86LoaderReqSymLists(SymbolList, NULL); - - return pModule; -} - -/* * ATILoadModules -- * * This function loads other modules required for a screen. @@ -206,7 +45,7 @@ ATILoadModules /* Load shadow frame buffer code if needed */ if (pATI->OptionShadowFB && - !ATILoadModule(pScreenInfo, "shadowfb", ATIshadowfbSymbols)) + !xf86LoadSubModule(pScreenInfo, "shadowfb")) return NULL; /* Load depth-specific entry points */ @@ -216,7 +55,7 @@ ATILoadModules case 16: case 24: case 32: - fbPtr = ATILoadModule(pScreenInfo, "fb", ATIfbSymbols); + fbPtr = xf86LoadSubModule(pScreenInfo, "fb"); break; default: @@ -227,14 +66,13 @@ ATILoadModules /* Load ramdac module if needed */ if ((pATI->Cursor > ATI_CURSOR_SOFTWARE) && - !ATILoadModule(pScreenInfo, "ramdac", ATIramdacSymbols)) + !xf86LoadSubModule(pScreenInfo, "ramdac")) return NULL; #ifdef USE_EXA /* Load EXA if needed */ if (pATI->useEXA && pATI->OptionAccel) { - /* Cannot use ATILoadModule(), because of version checking */ XF86ModReqInfo req; int errmaj, errmin; @@ -247,17 +85,14 @@ ATILoadModules LoaderErrorMsg(NULL, "exa", errmaj, errmin); return NULL; } - xf86LoaderReqSymLists(ATIexaSymbols, NULL); } #endif #ifdef USE_XAA /* Load XAA if needed */ if (!pATI->useEXA && pATI->OptionAccel && - !ATILoadModule(pScreenInfo, "xaa", ATIxaaSymbols)) + !xf86LoadSubModule(pScreenInfo, "xaa")) return NULL; #endif return fbPtr; } - -#endif /* XFree86LOADER */ diff --git a/src/atiload.h b/src/atiload.h index ebccd758..168224c7 100644 --- a/src/atiload.h +++ b/src/atiload.h @@ -18,52 +18,15 @@ * 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. - * - * DRI support by: - * Leif Delgass <ldelgass@retinalburn.net> */ #ifndef ___ATILOAD_H___ #define ___ATILOAD_H___ 1 -#ifdef XFree86LOADER - #include "atipriv.h" #include "xf86str.h" -extern const char *ATIint10Symbols[], *ATIddcSymbols[], *ATIvbeSymbols[], - -#ifdef XF86DRI_DEVEL - - *ATIdrmSymbols[], *ATIdriSymbols[], - -#endif /* XF86DRI_DEVEL */ - - *ATIfbSymbols[], *ATIshadowfbSymbols[], - -#ifdef USE_EXA - - *ATIexaSymbols[], - -#endif /* USE_EXA */ - -#ifdef USE_XAA - - *ATIxaaSymbols[], - -#endif /* USE_XAA */ - - *ATIramdacSymbols[], *ATIi2cSymbols[]; - -extern pointer ATILoadModule(ScrnInfoPtr, const char *, const char **); extern pointer ATILoadModules(ScrnInfoPtr, ATIPtr); -#else /* XFree86LOADER */ - -#define ATILoadModule(pScreenInfo, Module, SymboList) ((pointer)1) -#define ATILoadModules(pScreenInfo, pATI) ((pointer)1) - -#endif /* XFree86LOADER */ - #endif /* ___ATILOAD_H___ */ diff --git a/src/atimisc.c b/src/atimisc.c index e6012ecd..b10d08fa 100644 --- a/src/atimisc.c +++ b/src/atimisc.c @@ -18,19 +18,13 @@ * 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. - * - * DRI support by: - * Leif Delgass <ldelgass@retinalburn.net> */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef XFree86LOADER - #include "ati.h" -#include "atiload.h" #include "ativersion.h" /* Module loader interface for subsidiary driver module */ @@ -101,41 +95,6 @@ ATISetup } while (0); } - /* - * Tell loader about symbols from other modules that this module might - * refer to. - */ - xf86LoaderRefSymLists( - ATIint10Symbols, - ATIddcSymbols, - ATIvbeSymbols, - -#ifdef XF86DRI_DEVEL - - ATIdrmSymbols, - ATIdriSymbols, - -#endif /* XF86DRI_DEVEL */ - - ATIfbSymbols, - ATIshadowfbSymbols, - -#ifdef USE_EXA - - ATIexaSymbols, - -#endif /* USE_EXA */ - -#ifdef USE_XAA - - ATIxaaSymbols, - -#endif /* USE_XAA */ - - ATIramdacSymbols, - ATIi2cSymbols, - NULL); - Inited = TRUE; } @@ -149,5 +108,3 @@ _X_EXPORT XF86ModuleData atimiscModuleData = ATISetup, NULL }; - -#endif /* XFree86LOADER */ diff --git a/src/atimode.c b/src/atimode.c index 68c13426..d1b31981 100644 --- a/src/atimode.c +++ b/src/atimode.c @@ -43,12 +43,6 @@ #include "vbe.h" -static const char *vbeSymbols[] = { - "VBESetVBEMode", - "vbeFree", - NULL -}; - #endif /* TV_OUT */ #ifndef AVOID_CPIO @@ -733,9 +727,6 @@ ATISetVBEMode ATIHWPtr pATIHW ) { - - xf86LoaderRefSymLists(vbeSymbols, NULL); - if (pATIHW->crtc == ATI_CRTC_MACH64) { int vbemode, modekey; diff --git a/src/atimodule.c b/src/atimodule.c index 6aa9a2e7..12b4ffd9 100644 --- a/src/atimodule.c +++ b/src/atimodule.c @@ -24,38 +24,11 @@ #include "config.h" #endif -#ifdef XFree86LOADER - #include "ati.h" -#include "atimodule.h" #include "ativersion.h" /* Module loader interface */ -const char *ATISymbols[] = -{ - "Mach64Identify", - "Mach64Probe", - "Mach64AvailableOptions", - NULL -}; - -const char *R128Symbols[] = -{ - "R128Identify", - "R128Probe", - "R128AvailableOptions", - NULL -}; - -const char *RADEONSymbols[] = -{ - "RADEONIdentify", - "RADEONProbe", - "RADEONAvailableOptions", - NULL -}; - static XF86ModuleVersionInfo ATIVersionRec = { ATI_DRIVER_NAME, @@ -90,12 +63,6 @@ ATISetup { Inited = TRUE; xf86AddDriver(&ATI, Module, 0); - - xf86LoaderRefSymLists( - ATISymbols, - R128Symbols, - RADEONSymbols, - NULL); } return (pointer)1; @@ -108,5 +75,3 @@ _X_EXPORT XF86ModuleData atiModuleData = ATISetup, NULL }; - -#endif /* XFree86LOADER */ diff --git a/src/atimodule.h b/src/atimodule.h deleted file mode 100644 index d33b01d7..00000000 --- a/src/atimodule.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@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. - */ - -#if defined(XFree86LOADER) && !defined(___ATIMODULE_H___) -#define ___ATIMODULE_H___ 1 - -extern const char *ATISymbols[]; -extern const char *R128Symbols[]; -extern const char *RADEONSymbols[]; - -#endif /* ___ATIMODULE_H___ */ diff --git a/src/atipreinit.c b/src/atipreinit.c index 8114f512..2420b9f8 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -301,7 +301,7 @@ ATIPreInit * If there is an ix86-style BIOS, ensure its initialisation entry point * has been executed, and retrieve DDC and VBE information from it. */ - if (!(pInt10Module = ATILoadModule(pScreenInfo, "int10", ATIint10Symbols))) + if (!(pInt10Module = xf86LoadSubModule(pScreenInfo, "int10"))) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Unable to load int10 module.\n"); @@ -313,13 +313,13 @@ ATIPreInit } else { - if (!(pDDCModule = ATILoadModule(pScreenInfo, "ddc", ATIddcSymbols))) + if (!(pDDCModule = xf86LoadSubModule(pScreenInfo, "ddc"))) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Unable to load ddc module.\n"); } else - if (!(pVBEModule = ATILoadModule(pScreenInfo, "vbe", ATIvbeSymbols))) + if (!(pVBEModule = xf86LoadSubModule(pScreenInfo, "vbe"))) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Unable to load vbe module.\n"); @@ -63,6 +63,8 @@ #include "GL/glxint.h" #endif +#include "atipcirename.h" + #define R128_DEBUG 0 /* Turn off debugging output */ #define R128_IDLE_RETRY 32 /* Fall out of idle loops after this count */ #define R128_TIMEOUT 2000000 /* Fall out of wait loops after this count */ @@ -234,8 +236,8 @@ typedef struct { unsigned long MMIOAddr; /* MMIO region physical address */ unsigned long BIOSAddr; /* BIOS physical address */ - unsigned char *MMIO; /* Map of MMIO region */ - unsigned char *FB; /* Map of frame buffer */ + void *MMIO; /* Map of MMIO region */ + void *FB; /* Map of frame buffer */ CARD32 MemCntl; CARD32 BusCntl; diff --git a/src/r128_cursor.c b/src/r128_cursor.c index 908ddb98..83212843 100644 --- a/src/r128_cursor.c +++ b/src/r128_cursor.c @@ -133,7 +133,7 @@ static void R128LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *image) R128InfoPtr info = R128PTR(pScrn); unsigned char *R128MMIO = info->MMIO; CARD32 *s = (pointer)image; - CARD32 *d = (pointer)(info->FB + info->cursor_start); + CARD32 *d = (pointer)((CARD8*)info->FB + info->cursor_start); int y; CARD32 save; diff --git a/src/r128_dri.c b/src/r128_dri.c index edb77bac..da201e3b 100644 --- a/src/r128_dri.c +++ b/src/r128_dri.c @@ -470,8 +470,8 @@ static Bool R128DRIAgpInit(R128InfoPtr info, 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, - info->PciInfo->vendor, - info->PciInfo->chipType); + PCI_DEV_VENDOR_ID(info->PciInfo), + PCI_DEV_DEVICE_ID(info->PciInfo)); if (drmAgpEnable(info->drmFD, mode) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] AGP not enabled\n"); @@ -910,9 +910,9 @@ static void R128DRIIrqInit(R128InfoPtr info, ScreenPtr pScreen) if (!info->irq) { info->irq = drmGetInterruptFromBusID( info->drmFD, - ((pciConfigPtr)info->PciInfo->thisCard)->busnum, - ((pciConfigPtr)info->PciInfo->thisCard)->devnum, - ((pciConfigPtr)info->PciInfo->thisCard)->funcnum); + PCI_CFG_BUS(info->PciInfo), + PCI_CFG_DEV(info->PciInfo), + PCI_CFG_FUNC(info->PciInfo)); if((drmCtlInstHandler(info->drmFD, info->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1029,9 +1029,9 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), + PCI_DEV_FUNC(info->PciInfo)); } pDRIInfo->ddxDriverMajorVersion = R128_VERSION_MAJOR; pDRIInfo->ddxDriverMinorVersion = R128_VERSION_MINOR; diff --git a/src/r128_driver.c b/src/r128_driver.c index 9c41b7bc..45917cd0 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -194,186 +194,6 @@ R128RAMRec R128RAM[] = { /* Memory Specifications { 4, 4, 3, 3, 2, 3, 1, 16, 12, "64-bit DDR SGRAM" }, }; -#ifdef WITH_VGAHW -static const char *vgahwSymbols[] = { - "vgaHWFreeHWRec", - "vgaHWGetHWRec", - "vgaHWGetIndex", - "vgaHWLock", - "vgaHWRestore", - "vgaHWSave", - "vgaHWUnlock", - NULL -}; -#endif - -static const char *fbdevHWSymbols[] = { - "fbdevHWInit", - "fbdevHWUseBuildinMode", - "fbdevHWGetLineLength", - "fbdevHWGetVidmem", - - "fbdevHWDPMSSet", - "fbdevHWDPMSSetWeak", - - /* colormap */ - "fbdevHWLoadPalette", - "fbdevHWLoadPaletteWeak", - - /* ScrnInfo hooks */ - "fbdevHWAdjustFrame", - "fbdevHWAdjustFrameWeak", - "fbdevHWEnterVT", - "fbdevHWLeaveVT", - "fbdevHWModeInit", - "fbdevHWRestore", - "fbdevHWSave", - "fbdevHWSwitchMode", - "fbdevHWSwitchModeWeak", - "fbdevHWValidModeWeak", - - "fbdevHWMapMMIO", - "fbdevHWMapVidmem", - "fbdevHWUnmapMMIO", - "fbdevHWUnmapVidmem", - - NULL -}; - -static const char *ddcSymbols[] = { - "xf86PrintEDID", - "xf86DoEDID_DDC1", - "xf86DoEDID_DDC2", - NULL -}; - -static const char *i2cSymbols[] = { - "xf86CreateI2CBusRec", - "xf86I2CBusInit", - NULL -}; - -static const char *fbSymbols[] = { - "fbPictureInit", - "fbScreenInit", - NULL -}; - -static const char *xaaSymbols[] = { - "XAACreateInfoRec", - "XAADestroyInfoRec", - "XAAInit", - NULL -}; - -static const char *ramdacSymbols[] = { - "xf86CreateCursorInfoRec", - "xf86DestroyCursorInfoRec", - "xf86InitCursor", - NULL -}; - -#ifdef XF86DRI -static const char *drmSymbols[] = { - "drmAddBufs", - "drmAddMap", - "drmAgpAcquire", - "drmAgpAlloc", - "drmAgpBase", - "drmAgpBind", - "drmAgpDeviceId", - "drmAgpEnable", - "drmAgpFree", - "drmAgpGetMode", - "drmAgpRelease", - "drmAgpUnbind", - "drmAgpVendorId", - "drmAvailable", - "drmCommandNone", - "drmCommandRead", - "drmCommandWrite", - "drmCommandWriteRead", - "drmCtlInstHandler", - "drmCtlUninstHandler", - "drmFreeBufs", - "drmFreeVersion", - "drmGetInterruptFromBusID", - "drmGetLibVersion", - "drmGetVersion", - "drmMap", - "drmMapBufs", - "drmDMA", - "drmScatterGatherAlloc", - "drmScatterGatherFree", - "drmUnmap", - "drmUnmapBufs", - NULL -}; - -static const char *driSymbols[] = { - "DRICloseScreen", - "DRICreateInfoRec", - "DRIDestroyInfoRec", - "DRIFinishScreenInit", - "DRIGetDeviceInfo", - "DRIGetSAREAPrivate", - "DRILock", - "DRIQueryVersion", - "DRIScreenInit", - "DRIUnlock", - "GlxSetVisualConfigs", - "DRICreatePCIBusID", - NULL -}; - -static const char *driShadowFBSymbols[] = { - "ShadowFBInit", - NULL -}; -#endif - -static const char *vbeSymbols[] = { - "VBEInit", - "vbeDoEDID", - "vbeFree", - NULL -}; - -static const char *int10Symbols[] = { - "xf86InitInt10", - "xf86FreeInt10", - "xf86int10Addr", - NULL -}; - -void R128LoaderRefSymLists(void) -{ - /* - * Tell the loader about symbols from other modules that this module might - * refer to. - */ - xf86LoaderRefSymLists( -#ifdef WITH_VGAHW - vgahwSymbols, -#endif - fbSymbols, - xaaSymbols, - ramdacSymbols, -#ifdef XF86DRI - drmSymbols, - driSymbols, - driShadowFBSymbols, -#endif - fbdevHWSymbols, - int10Symbols, - vbeSymbols, - /* ddcsymbols, */ - i2cSymbols, - /* shadowSymbols, */ - NULL); -} - -#ifdef XFree86LOADER int getR128EntityIndex(void) { int *r128_entity_index = LoaderSymbol("gR128EntityIndex"); @@ -382,13 +202,6 @@ int getR128EntityIndex(void) else return *r128_entity_index; } -#else -extern int gR128EntityIndex; -int getR128EntityIndex(void) -{ - return gR128EntityIndex; -} -#endif R128EntPtr R128EntPriv(ScrnInfoPtr pScrn) { @@ -425,11 +238,26 @@ static Bool R128MapMMIO(ScrnInfoPtr pScrn) if (info->FBDev) { info->MMIO = fbdevHWMapMMIO(pScrn); } else { +#ifndef XSERVER_LIBPCIACCESS info->MMIO = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, info->PciTag, info->MMIOAddr, R128_MMIOSIZE); +#else + int err = pci_device_map_range(info->PciInfo, + info->MMIOAddr, + R128_MMIOSIZE, + PCI_DEV_MAP_FLAG_WRITABLE, + &info->MMIO); + + if (err) { + xf86DrvMsg (pScrn->scrnIndex, X_ERROR, + "Unable to map MMIO aperture. %s (%d)\n", + strerror (err), err); + return FALSE; + } +#endif } if (!info->MMIO) return FALSE; @@ -445,7 +273,11 @@ static Bool R128UnmapMMIO(ScrnInfoPtr pScrn) if (info->FBDev) fbdevHWUnmapMMIO(pScrn); else { +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, info->MMIO, R128_MMIOSIZE); +#else + pci_device_unmap_range(info->PciInfo, info->MMIO, R128_MMIOSIZE); +#endif } info->MMIO = NULL; return TRUE; @@ -459,11 +291,27 @@ static Bool R128MapFB(ScrnInfoPtr pScrn) if (info->FBDev) { info->FB = fbdevHWMapVidmem(pScrn); } else { +#ifndef XSERVER_LIBPCIACCESS info->FB = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, info->PciTag, info->LinearAddr, info->FbMapSize); +#else + int err = pci_device_map_range(info->PciInfo, + info->LinearAddr, + info->FbMapSize, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, + &info->FB); + + if (err) { + xf86DrvMsg (pScrn->scrnIndex, X_ERROR, + "Unable to map FB aperture. %s (%d)\n", + strerror (err), err); + return FALSE; + } +#endif } if (!info->FB) return FALSE; @@ -478,7 +326,11 @@ static Bool R128UnmapFB(ScrnInfoPtr pScrn) if (info->FBDev) fbdevHWUnmapVidmem(pScrn); else +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, info->FB, info->FbMapSize); +#else + pci_device_unmap_range(info->PciInfo, info->FB, info->FbMapSize); +#endif info->FB = NULL; return TRUE; } @@ -639,7 +491,13 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) (info->VBIOS[(v) + 2] << 16) | \ (info->VBIOS[(v) + 3] << 24)) - if (!(info->VBIOS = xalloc(R128_VBIOS_SIZE))) { +#ifdef XSERVER_LIBPCIACCESS + info->VBIOS = xalloc(info->PciInfo->rom_size); +#else + info->VBIOS = xalloc(R128_VBIOS_SIZE); +#endif + + if (!info->VBIOS) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot allocate space for hold Video BIOS!\n"); return FALSE; @@ -650,6 +508,12 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) (void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr), R128_VBIOS_SIZE); } else { +#ifdef XSERVER_LIBPCIACCESS + if (pci_device_read_rom(info->PciInfo, info->VBIOS)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to read PCI ROM!\n"); + } +#else xf86ReadPciBIOS(0, info->PciTag, 0, info->VBIOS, R128_VBIOS_SIZE); if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -659,6 +523,7 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) info->BIOSAddr = 0x000c0000; xf86ReadDomainMemory(info->PciTag, info->BIOSAddr, R128_VBIOS_SIZE, info->VBIOS); } +#endif } if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) { info->BIOSAddr = 0x00000000; @@ -997,7 +862,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) info->Chipset = dev->chipID; from = X_CONFIG; } else { - info->Chipset = info->PciInfo->chipType; + info->Chipset = PCI_DEV_DEVICE_ID(info->PciInfo); } pScrn->chipset = (char *)xf86TokenToString(R128Chipsets, info->Chipset); @@ -1021,7 +886,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) /* Framebuffer */ from = X_PROBED; - info->LinearAddr = info->PciInfo->memBase[0] & 0xfc000000; + info->LinearAddr = PCI_REGION_BASE(info->PciInfo, 0, REGION_MEM) & 0xfc000000; pScrn->memPhysBase = info->LinearAddr; if (dev->MemBase) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1040,7 +905,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) /* MMIO registers */ from = X_PROBED; - info->MMIOAddr = info->PciInfo->memBase[2] & 0xffffff00; + info->MMIOAddr = PCI_REGION_BASE(info->PciInfo, 2, REGION_MEM) & 0xffffff00; if (dev->IOBase) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MMIO address override, using 0x%08lx instead of 0x%08lx\n", @@ -1055,6 +920,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%08lx\n", info->MMIOAddr); +#ifndef XSERVER_LIBPCIACCESS /* BIOS */ from = X_PROBED; info->BIOSAddr = info->PciInfo->biosBase & 0xfffe0000; @@ -1070,6 +936,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, from, "BIOS at 0x%08lx\n", info->BIOSAddr); } +#endif /* Flat panel (part 1) */ if (xf86GetOptValBool(info->Options, OPTION_PROG_FP_REGS, @@ -1382,14 +1249,12 @@ static Bool R128PreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) #endif if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE; - xf86LoaderReqSymLists(ddcSymbols, NULL); #if defined(__powerpc__) || defined(__alpha__) || defined(__sparc__) /* Int10 is broken on PPC and some Alphas */ return TRUE; #else if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols,NULL); pVbe = VBEInit(pInt10,info->pEnt->index); if (!pVbe) return FALSE; xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(pVbe,NULL))); @@ -1444,9 +1309,7 @@ static Bool R128I2cInit(ScrnInfoPtr pScrn) { R128InfoPtr info = R128PTR(pScrn); - if ( xf86LoadSubModule(pScrn, "i2c") ) - xf86LoaderReqSymLists(i2cSymbols,NULL); - else{ + if ( !xf86LoadSubModule(pScrn, "i2c") ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to load i2c module\n"); return FALSE; @@ -1866,7 +1729,6 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn) /* Get ScreenInit function */ if (!xf86LoadSubModule(pScrn, "fb")) return FALSE; - xf86LoaderReqSymLists(fbSymbols, NULL); info->CurrentLayout.displayWidth = pScrn->displayWidth; info->CurrentLayout.mode = pScrn->currentMode; @@ -1881,7 +1743,6 @@ static Bool R128PreInitCursor(ScrnInfoPtr pScrn) if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); } return TRUE; } @@ -1893,7 +1754,6 @@ static Bool R128PreInitAccel(ScrnInfoPtr pScrn) if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE; - xf86LoaderReqSymLists(xaaSymbols, NULL); } return TRUE; } @@ -1904,7 +1764,6 @@ static Bool R128PreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10) #if 1 && !defined(__alpha__) /* int10 is broken on some Alphas */ if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); *ppInt10 = xf86InitInt10(info->pEnt->index); } @@ -2018,8 +1877,6 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't load shadowfb module:\n"); } else { - xf86LoaderReqSymLists(driShadowFBSymbols, NULL); - info->allowPageFlip = xf86ReturnOptValBool(info->Options, OPTION_PAGE_FLIP, FALSE); @@ -2101,15 +1958,15 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) } info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index); - info->PciTag = pciTag(info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + info->PciTag = pciTag(PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), + PCI_DEV_FUNC(info->PciInfo)); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PCI bus %d card %d func %d\n", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), + PCI_DEV_FUNC(info->PciInfo)); if (xf86RegisterResources(info->pEnt->index, 0, ResNone)) goto fail; if (xf86SetOperatingState(resVga, info->pEnt->index, ResUnusedOpr)) goto fail; @@ -2139,7 +1996,6 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) if (!xf86LoadSubModule(pScrn, "vgahw")) info->VGAAccess = FALSE; else { - xf86LoaderReqSymLists(vgahwSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) info->VGAAccess = FALSE; } @@ -2186,7 +2042,6 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) if (info->FBDev) { /* check for linux framebuffer device */ if (!xf86LoadSubModule(pScrn, "fbdevhw")) return FALSE; - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn, info->PciInfo, NULL)) return FALSE; pScrn->SwitchMode = fbdevHWSwitchModeWeak(); pScrn->AdjustFrame = fbdevHWAdjustFrameWeak(); diff --git a/src/r128_misc.c b/src/r128_misc.c index 5ace7d7c..49d2803b 100644 --- a/src/r128_misc.c +++ b/src/r128_misc.c @@ -24,8 +24,6 @@ #include "config.h" #endif -#ifdef XFree86LOADER - #include "ativersion.h" #include "r128_probe.h" @@ -71,8 +69,6 @@ R128Setup if (!xf86ServerIsOnlyDetecting() && !LoaderSymbol(ATI_NAME)) xf86LoadOneModule(ATI_DRIVER_NAME, Options); - R128LoaderRefSymLists(); - Inited = TRUE; } @@ -86,5 +82,3 @@ _X_EXPORT XF86ModuleData r128ModuleData = R128Setup, NULL }; - -#endif /* XFree86LOADER */ diff --git a/src/r128_probe.h b/src/r128_probe.h index 180e52a9..82d0fbea 100644 --- a/src/r128_probe.h +++ b/src/r128_probe.h @@ -61,7 +61,6 @@ extern Bool R128Probe(DriverPtr, int); extern PciChipsets R128PciChipsets[]; /* r128_driver.c */ -extern void R128LoaderRefSymLists(void); extern Bool R128PreInit(ScrnInfoPtr, int); extern Bool R128ScreenInit(int, ScreenPtr, int, char **); extern Bool R128SwitchMode(int, DisplayModePtr, int); diff --git a/src/r128_video.c b/src/r128_video.c index 0f715aab..8e833235 100644 --- a/src/r128_video.c +++ b/src/r128_video.c @@ -397,6 +397,7 @@ R128DMA( #define BUFSIZE (R128_BUFFER_SIZE - R128_HOSTDATA_BLIT_OFFSET) #define MAXPASSES (MAXHEIGHT/(BUFSIZE/(MAXWIDTH*2))+1) + unsigned char *fb = (CARD8*)info->FB; unsigned char *buf; int err=-1, i, idx, offset, hpass, passes, srcpassbytes, dstpassbytes; int sizes[MAXPASSES], list[MAXPASSES]; @@ -439,7 +440,7 @@ R128DMA( dstpassbytes = hpass*dstPitch; dstPitch /= 8; - for (i=0, offset=dst-info->FB; i<passes; i++, offset+=dstpassbytes) { + for (i=0, offset=dst-fb; i<passes; i++, offset+=dstpassbytes) { if (i == (passes-1) && (h % hpass) != 0) { hpass = h % hpass; srcpassbytes = w*hpass; @@ -775,6 +776,7 @@ R128PutImage( ){ R128InfoPtr info = R128PTR(pScrn); R128PortPrivPtr pPriv = (R128PortPrivPtr)data; + unsigned char *fb = (CARD8*)info->FB; INT32 xa, xb, ya, yb; int new_size, offset, s1offset, s2offset, s3offset; int srcPitch, srcPitch2, dstPitch; @@ -899,7 +901,7 @@ R128PutImage( nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top; R128CopyData420(info, buf + s1offset, buf + s2offset, buf + s3offset, - info->FB+d1offset, info->FB+d2offset, info->FB+d3offset, + fb + d1offset, fb + d2offset, fb + d3offset, srcPitch, srcPitch2, dstPitch, nlines, npixels); break; case FOURCC_UYVY: @@ -914,7 +916,7 @@ R128PutImage( d3offset = 0; s1offset += (top * srcPitch) + left; nlines = ((yb + 0xffff) >> 16) - top; - R128CopyData422(info, buf + s1offset, info->FB + d1offset, + R128CopyData422(info, buf + s1offset, fb + d1offset, srcPitch, dstPitch, nlines, npixels); break; } diff --git a/src/radeon.h b/src/radeon.h index bddbc7b9..2a3838c8 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -670,14 +670,12 @@ typedef struct { OptionInfoPtr Options; Bool useEXA; -#ifdef XFree86LOADER #ifdef USE_EXA XF86ModReqInfo exaReq; #endif #ifdef USE_XAA XF86ModReqInfo xaaReq; #endif -#endif /* X itself has the 3D context */ Bool XInited3D; diff --git a/src/radeon_accelfuncs.c b/src/radeon_accelfuncs.c index 6fbbc138..e3b37c16 100644 --- a/src/radeon_accelfuncs.c +++ b/src/radeon_accelfuncs.c @@ -1182,9 +1182,7 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a) a->SubsequentSolidHorVertLine = FUNC_NAME(RADEONSubsequentSolidHorVertLine); -#ifdef XFree86LOADER if (info->xaaReq.minorversion >= 1) { -#endif /* RADEON only supports 14 bits for lines and clipping and only * draws lines that are completely on-screen correctly. This will @@ -1231,12 +1229,10 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a) a->DashedLineLimits.y2 = pScrn->virtualY-1; } -#ifdef XFree86LOADER } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "libxaa too old, can't accelerate TwoPoint lines\n"); } -#endif /* Clipping, note that without this, all line accelerations will * not be called @@ -1296,11 +1292,7 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a) #endif #ifdef RENDER - if (info->RenderAccel -#ifdef XFree86LOADER - && info->xaaReq.minorversion >= 2 -#endif - ) { + if (info->RenderAccel && info->xaaReq.minorversion >= 2) { a->CPUToScreenAlphaTextureFlags = XAA_RENDER_POWER_OF_2_TILE_ONLY; a->CPUToScreenAlphaTextureFormats = RADEONTextureFormats; diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 07f96a73..98b8c684 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -225,197 +225,6 @@ static const OptionInfoRec RADEONOptions[] = { const OptionInfoRec *RADEONOptionsWeak(void) { return RADEONOptions; } -#ifdef WITH_VGAHW -static const char *vgahwSymbols[] = { - "vgaHWFreeHWRec", - "vgaHWGetHWRec", - "vgaHWGetIndex", - "vgaHWLock", - "vgaHWRestore", - "vgaHWSave", - "vgaHWUnlock", - "vgaHWGetIOBase", - NULL -}; -#endif - -static const char *ddcSymbols[] = { - "xf86PrintEDID", - "xf86DoEDID_DDC1", - "xf86DoEDID_DDC2", - NULL -}; - -static const char *fbSymbols[] = { - "fbScreenInit", - "fbPictureInit", - NULL -}; - - -#ifdef USE_EXA -static const char *exaSymbols[] = { - "exaDriverAlloc", - "exaDriverInit", - "exaDriverFini", - "exaOffscreenAlloc", - "exaOffscreenFree", - "exaGetPixmapOffset", - "exaGetPixmapPitch", - "exaGetPixmapSize", - "exaMarkSync", - "exaWaitSync", - NULL -}; -#endif /* USE_EXA */ - -#ifdef USE_XAA -static const char *xaaSymbols[] = { - "XAACreateInfoRec", - "XAADestroyInfoRec", - "XAAInit", - NULL -}; -#endif /* USE_XAA */ - -#if 0 -static const char *xf8_32bppSymbols[] = { - "xf86Overlay8Plus32Init", - NULL -}; -#endif - -static const char *ramdacSymbols[] = { - "xf86CreateCursorInfoRec", - "xf86DestroyCursorInfoRec", - "xf86ForceHWCursor", - "xf86InitCursor", - NULL -}; - -#ifdef XF86DRI -static const char *drmSymbols[] = { - "drmGetInterruptFromBusID", - "drmCtlInstHandler", - "drmCtlUninstHandler", - "drmAddBufs", - "drmAddMap", - "drmAgpAcquire", - "drmAgpAlloc", - "drmAgpBase", - "drmAgpBind", - "drmAgpDeviceId", - "drmAgpEnable", - "drmAgpFree", - "drmAgpGetMode", - "drmAgpRelease", - "drmAgpUnbind", - "drmAgpVendorId", - "drmCommandNone", - "drmCommandRead", - "drmCommandWrite", - "drmCommandWriteRead", - "drmDMA", - "drmFreeVersion", - "drmGetLibVersion", - "drmGetVersion", - "drmMap", - "drmMapBufs", - "drmRadeonCleanupCP", - "drmRadeonClear", - "drmRadeonFlushIndirectBuffer", - "drmRadeonInitCP", - "drmRadeonResetCP", - "drmRadeonStartCP", - "drmRadeonStopCP", - "drmRadeonWaitForIdleCP", - "drmScatterGatherAlloc", - "drmScatterGatherFree", - "drmUnmap", - "drmUnmapBufs", - NULL -}; - -static const char *driSymbols[] = { - "DRICloseScreen", - "DRICreateInfoRec", - "DRIDestroyInfoRec", - "DRIFinishScreenInit", - "DRIGetContext", - "DRIGetDeviceInfo", - "DRIGetSAREAPrivate", - "DRILock", - "DRIQueryVersion", - "DRIScreenInit", - "DRIUnlock", - "GlxSetVisualConfigs", - "DRICreatePCIBusID", - NULL -}; -#endif - -static const char *vbeSymbols[] = { - "VBEInit", - "vbeDoEDID", - NULL -}; - -static const char *int10Symbols[] = { - "xf86InitInt10", - "xf86FreeInt10", - "xf86int10Addr", - "xf86ExecX86int10", - NULL -}; - -static const char *i2cSymbols[] = { - "xf86CreateI2CBusRec", - "xf86I2CBusInit", - NULL -}; - -static const char *shadowSymbols[] = { - "shadowAdd", - "shadowInit", - "shadowSetup", - "shadowUpdatePacked", - "shadowUpdatePackedWeak", - NULL -}; - -void RADEONLoaderRefSymLists(void) -{ - /* - * Tell the loader about symbols from other modules that this module might - * refer to. - */ - xf86LoaderRefSymLists( -#ifdef WITH_VGAHW - vgahwSymbols, -#endif - fbSymbols, -#ifdef USE_EXA - exaSymbols, -#endif -#ifdef USE_XAA - xaaSymbols, -#endif -#if 0 - xf8_32bppSymbols, -#endif - ramdacSymbols, -#ifdef XF86DRI - drmSymbols, - driSymbols, -#endif - vbeSymbols, - int10Symbols, - i2cSymbols, - ddcSymbols, - NULL); -} - -#ifdef XFree86LOADER static int getRADEONEntityIndex(void) { int *radeon_entity_index = LoaderSymbol("gRADEONEntityIndex"); @@ -424,13 +233,6 @@ static int getRADEONEntityIndex(void) else return *radeon_entity_index; } -#else -extern int gRADEONEntityIndex; -static int getRADEONEntityIndex(void) -{ - return gRADEONEntityIndex; -} -#endif struct RADEONInt10Save { CARD32 MEM_CNTL; @@ -2000,7 +1802,6 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) "using shadow framebuffer\n"); if (!xf86LoadSubModule(pScrn, "shadow")) return FALSE; - xf86LoaderReqSymLists(shadowSymbols, NULL); } return TRUE; } @@ -2016,16 +1817,13 @@ static void RADEONPreInitDDC(ScrnInfoPtr pScrn) if (!xf86LoadSubModule(pScrn, "ddc")) { info->ddc2 = FALSE; } else { - xf86LoaderReqSymLists(ddcSymbols, NULL); info->ddc2 = TRUE; } /* DDC can use I2C bus */ /* Load I2C if we have the code to use it */ if (info->ddc2) { - if (xf86LoadSubModule(pScrn, "i2c")) { - xf86LoaderReqSymLists(i2cSymbols,NULL); - } + xf86LoadSubModule(pScrn, "i2c"); } } @@ -2045,7 +1843,6 @@ static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn) if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); } return TRUE; } @@ -2053,7 +1850,6 @@ static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn) /* This is called by RADEONPreInit to initialize hardware acceleration */ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn) { -#ifdef XFree86LOADER RADEONInfoPtr info = RADEONPTR(pScrn); MessageType from; #if defined(USE_EXA) && defined(USE_XAA) @@ -2101,7 +1897,6 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn) LoaderErrorMsg(NULL, "exa", errmaj, errmin); return FALSE; } - xf86LoaderReqSymLists(exaSymbols, NULL); } #endif /* USE_EXA */ #ifdef USE_XAA @@ -2124,11 +1919,9 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn) } } } - xf86LoaderReqSymLists(xaaSymbols, NULL); } #endif /* USE_XAA */ } -#endif /* XFree86Loader */ return TRUE; } @@ -2141,8 +1934,6 @@ static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10) CARD32 fp2_gen_ctl_save = 0; if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); - /* The VGA BIOS on the RV100/QY cannot be read when the digital output * is enabled. Clear and restore FP2_ON around int10 to avoid this. */ @@ -2726,7 +2517,7 @@ static const xf86CrtcConfigFuncsRec RADEONCRTCResizeFuncs = { RADEONCRTCResize }; -_X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) +Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) { xf86CrtcConfigPtr xf86_config; RADEONInfoPtr info; @@ -2873,7 +2664,6 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) if (!xf86LoadSubModule(pScrn, "vgahw")) info->VGAAccess = FALSE; else { - xf86LoaderReqSymLists(vgahwSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) info->VGAAccess = FALSE; } @@ -2989,8 +2779,6 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) /* Get ScreenInit function */ if (!xf86LoadSubModule(pScrn, "fb")) return FALSE; - xf86LoaderReqSymLists(fbSymbols, NULL); - if (!RADEONPreInitGamma(pScrn)) goto fail; if (!RADEONPreInitCursor(pScrn)) goto fail; diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index 278d5a79..67c31478 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -55,7 +55,6 @@ #include <string.h> #include "radeon.h" -#include "atidri.h" #include "exa.h" diff --git a/src/radeon_misc.c b/src/radeon_misc.c index 17b987c9..7840376a 100644 --- a/src/radeon_misc.c +++ b/src/radeon_misc.c @@ -24,8 +24,6 @@ #include "config.h" #endif -#ifdef XFree86LOADER - #include "ativersion.h" #include "radeon_probe.h" @@ -70,8 +68,6 @@ RADEONSetup if (!xf86ServerIsOnlyDetecting() && !LoaderSymbol(ATI_NAME)) xf86LoadOneModule(ATI_DRIVER_NAME, Options); - RADEONLoaderRefSymLists(); - Inited = TRUE; } @@ -85,5 +81,3 @@ _X_EXPORT XF86ModuleData radeonModuleData = RADEONSetup, NULL }; - -#endif /* XFree86LOADER */ diff --git a/src/radeon_mm_i2c.c b/src/radeon_mm_i2c.c index cdb9437a..0524fa9c 100644 --- a/src/radeon_mm_i2c.c +++ b/src/radeon_mm_i2c.c @@ -410,14 +410,6 @@ void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) pPriv->i2c = NULL; return; } - xf86LoaderReqSymbols("xf86CreateI2CBusRec", - "xf86I2CBusInit", - "xf86DestroyI2CBus", - "xf86CreateI2CDevRec", - "xf86DestroyI2CDevRec", - "xf86I2CDevInit", - "xf86I2CWriteRead", - NULL); pPriv->i2c=CreateI2CBusRec(); pPriv->i2c->scrnIndex=pScrn->scrnIndex; pPriv->i2c->BusName="Radeon multimedia bus"; @@ -483,7 +475,6 @@ void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) } else { - xf86LoaderReqSymbols(FI1236SymbolsList, NULL); if(pPriv->fi1236 == NULL) { pPriv->fi1236 = xf86_Detect_FI1236(pPriv->i2c, FI1236_ADDR_1); @@ -512,7 +503,6 @@ void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) } else { - xf86LoaderReqSymbols(TDA9885SymbolsList, NULL); if(pPriv->tda9885 == NULL) { pPriv->tda9885 = xf86_Detect_tda9885(pPriv->i2c, TDA9885_ADDR_1); @@ -537,7 +527,6 @@ void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) } else { - xf86LoaderReqSymbols(TDA9885SymbolsList, NULL); if(pPriv->tda9885 == NULL) { pPriv->tda9885 = xf86_Detect_tda9885(pPriv->i2c, TDA9885_ADDR_1); @@ -560,7 +549,6 @@ void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) } else { - xf86LoaderReqSymbols(UDA1380SymbolsList, NULL); if(pPriv->uda1380 == NULL) { pPriv->uda1380 = xf86_Detect_uda1380(pPriv->i2c, UDA1380_ADDR_1); @@ -582,7 +570,6 @@ void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) } else { - xf86LoaderReqSymbols(MSP3430SymbolsList, NULL); if(pPriv->msp3430 == NULL) { pPriv->msp3430 = xf86_DetectMSP3430(pPriv->i2c, MSP3430_ADDR_1); @@ -616,7 +603,6 @@ void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) } else { - xf86LoaderReqSymbols(SAA7114SymbolsList, NULL); if(pPriv->saa7114 == NULL) { pPriv->saa7114 = xf86_DetectSAA7114(pPriv->i2c, SAA7114_ADDR_1); diff --git a/src/radeon_probe.h b/src/radeon_probe.h index a9ac5f6b..5828133b 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -550,7 +550,6 @@ extern Bool RADEONProbe(DriverPtr, int); extern PciChipsets RADEONPciChipsets[]; /* radeon_driver.c */ -extern void RADEONLoaderRefSymLists(void); extern Bool RADEONPreInit(ScrnInfoPtr, int); extern Bool RADEONScreenInit(int, ScreenPtr, int, char **); extern Bool RADEONSwitchMode(int, DisplayModePtr, int); diff --git a/src/radeon_video.c b/src/radeon_video.c index de706053..29d65080 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -1505,8 +1505,6 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"Unable to load Rage Theatre detect module\n"); goto skip_theatre; } - xf86LoaderReqSymbols(TheatreDetectSymbolsList, NULL); - RADEONSetupTheatre(pScrn, pPriv); /* @@ -1546,7 +1544,6 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn) goto skip_theatre; } } - xf86LoaderReqSymbols(TheatreSymbolsList, NULL); } if(pPriv->theatre!=NULL) diff --git a/src/theatre.h b/src/theatre.h index 3c1fd4b5..958b4438 100644 --- a/src/theatre.h +++ b/src/theatre.h @@ -57,25 +57,6 @@ void ResetTheatreRegsForTVout(TheatrePtr t); void ResetTheatreRegsForNoTVout(TheatrePtr t); -#define TheatreSymbolsList \ - "InitTheatre" \ - "RT_SetTint", \ - "RT_SetSaturation", \ - "RT_SetBrightness", \ - "RT_SetSharpness", \ - "RT_SetContrast", \ - "RT_SetInterlace", \ - "RT_SetStandard", \ - "RT_SetCombFilter", \ - "RT_SetOutputVideoSize", \ - "RT_SetConnector", \ - "ResetTheatreRegsForNoTVout", \ - "ResetTheatreRegsForTVout", \ - "DumpRageTheatreRegs", \ - "ShutdownTheatre" - -#ifdef XFree86LOADER - #define xf86_InitTheatre ((void (*)(TheatrePtr t))LoaderSymbol("InitTheatre")) #define xf86_RT_SetTint ((void (*)(TheatrePtr, int))LoaderSymbol("RT_SetTint")) @@ -94,24 +75,5 @@ void ResetTheatreRegsForNoTVout(TheatrePtr t); #define xf86_ResetTheatreRegsForTVout ((void (*)(TheatrePtr))LoaderSymbol("ResetTheatreRegsForTVout")) #define xf86_ResetTheatreRegsForNoTVout ((void (*)(TheatrePtr))LoaderSymbol("ResetTheatreRegsForNoTVout")) #define xf86_RT_GetSignalStatus ((void (*)(TheatrePtr))LoaderSymbol("xf86_RT_GetSignalStatus")) -#else - -#define xf86_InitTheatre InitTheatre - -#define xf86_RT_SetTint RT_SetTint -#define xf86_RT_SetSaturation RT_SetSaturation -#define xf86_RT_SetBrightness RT_SetBrightness -#define xf86_RT_SetSharpness RT_SetSharpness -#define xf86_RT_SetContrast RT_SetContrast -#define xf86_RT_SetInterlace RT_SetInterlace -#define xf86_RT_SetStandard RT_SetStandard -#define xf86_RT_SetOutputVideoSize RT_SetOutputVideoSize -#define xf86_RT_SetConnector RT_SetConnector - -#define xf86_RageTheatreDebugGain RageTheatreDebugGain -#define xf86_ShutdownTheatre ShutdownTheatre -#define xf86_DumpRageTheatreRegs DumpRageTheatreRegs -#define xf86_ResetTheatreRegsForNoTVout ResetTheatreRegsForNoTVout -#endif #endif diff --git a/src/theatre_detect.h b/src/theatre_detect.h index b414308f..5fed160e 100644 --- a/src/theatre_detect.h +++ b/src/theatre_detect.h @@ -41,17 +41,6 @@ TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b); -#define TheatreDetectSymbolsList \ - "DetectTheatre" - -#ifdef XFree86LOADER - #define xf86_DetectTheatre ((TheatrePtr (*)(GENERIC_BUS_Ptr))LoaderSymbol("DetectTheatre")) -#else - -#define xf86_DetectTheatre DetectTheatre - -#endif - #endif |