diff options
-rw-r--r-- | src/atifillin.c | 24 | ||||
-rw-r--r-- | src/atifillin.h | 22 | ||||
-rw-r--r-- | src/atiprobe.c | 122 | ||||
-rw-r--r-- | src/r128_driver.c | 31 | ||||
-rw-r--r-- | src/r128_probe.c | 42 | ||||
-rw-r--r-- | src/r128_probe.h | 8 | ||||
-rw-r--r-- | src/radeon_accel.c | 2 | ||||
-rw-r--r-- | src/radeon_driver.c | 27 | ||||
-rw-r--r-- | src/radeon_probe.c | 52 | ||||
-rw-r--r-- | src/radeon_probe.h | 14 | ||||
-rw-r--r-- | src/radeon_video.c | 2 |
11 files changed, 151 insertions, 195 deletions
diff --git a/src/atifillin.c b/src/atifillin.c new file mode 100644 index 00000000..76df7550 --- /dev/null +++ b/src/atifillin.c @@ -0,0 +1,24 @@ +/* + * atifillin.c: fill in a ScrnInfoPtr with the relevant information for + * atimisc. + * + * (c) 2004 Adam Jackson. Standard MIT license applies. + */ + +#include "atifillin.h" + +void ATIFillInScreenInfo(ScrnInfoPtr pScreenInfo) +{ + pScreenInfo->driverVersion = ATI_VERSION_CURRENT; + pScreenInfo->driverName = ATI_DRIVER_NAME; + pScreenInfo->name = ATI_NAME; + pScreenInfo->Probe = ATIProbe; + pScreenInfo->PreInit = ATIPreInit; + pScreenInfo->ScreenInit = ATIScreenInit; + pScreenInfo->SwitchMode = ATISwitchMode; + pScreenInfo->AdjustFrame = ATIAdjustFrame; + pScreenInfo->EnterVT = ATIEnterVT; + pScreenInfo->LeaveVT = ATILeaveVT; + pScreenInfo->FreeScreen = ATIFreeScreen; + pScreenInfo->ValidMode = ATIValidMode; +} diff --git a/src/atifillin.h b/src/atifillin.h new file mode 100644 index 00000000..824b7916 --- /dev/null +++ b/src/atifillin.h @@ -0,0 +1,22 @@ +/* + * atifillin.h: header for atifillin.c. + * + * (c) 2004 Adam Jackson. Standard MIT license applies. + */ + +#ifndef ATI_FILLIN_H +#define ATI_FILLIN_H + +/* include headers corresponding to fields touched by ATIFillInScreenInfo() */ + +#include "ativersion.h" +#include "atiprobe.h" +#include "atipreinit.h" +#include "atiscreen.h" +#include "aticonsole.h" +#include "atiadjust.h" +#include "ativalid.h" + +extern void ATIFillInScreenInfo FunctionPrototype((ScrnInfoPtr)); + +#endif diff --git a/src/atiprobe.c b/src/atiprobe.c index 8dc80ba1..08cc56f3 100644 --- a/src/atiprobe.c +++ b/src/atiprobe.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.60 2003/10/07 22:47:11 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.62tsi Exp $ */ /* - * Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2004 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 @@ -27,6 +27,7 @@ #include "atibus.h" #include "atichip.h" #include "aticonsole.h" +#include "atifillin.h" #include "atiident.h" #include "atimach64io.h" #include "atimodule.h" @@ -57,32 +58,6 @@ * largely ignored. */ -#ifdef XFree86LOADER - -/* - * The following exists to prevent the compiler from considering entry points - * defined in a separate module from being constants. - */ -static xf86PreInitProc * const volatile PreInitProc = ATIPreInit; -static xf86ScreenInitProc * const volatile ScreenInitProc = ATIScreenInit; -static xf86SwitchModeProc * const volatile SwitchModeProc = ATISwitchMode; -static xf86AdjustFrameProc * const volatile AdjustFrameProc = ATIAdjustFrame; -static xf86EnterVTProc * const volatile EnterVTProc = ATIEnterVT; -static xf86LeaveVTProc * const volatile LeaveVTProc = ATILeaveVT; -static xf86FreeScreenProc * const volatile FreeScreenProc = ATIFreeScreen; -static xf86ValidModeProc * const volatile ValidModeProc = ATIValidMode; - -#define ATIPreInit PreInitProc -#define ATIScreenInit ScreenInitProc -#define ATISwitchMode SwitchModeProc -#define ATIAdjustFrame AdjustFrameProc -#define ATIEnterVT EnterVTProc -#define ATILeaveVT LeaveVTProc -#define ATIFreeScreen FreeScreenProc -#define ATIValidMode ValidModeProc - -#endif - /* Used as a temporary buffer */ #define Identifier ((char *)(pATI->MMIOCache)) @@ -214,6 +189,8 @@ ATICheckSparseIOBases return DoProbe; } +#ifndef AVOID_NON_PCI + /* * ATIClaimSparseIOBases -- * @@ -236,6 +213,8 @@ ATIClaimSparseIOBases ProbeFlags[FirstPort] = ProbeFlag; } +#endif /* AVOID_NON_PCI */ + /* * ATIVGAProbe -- * @@ -803,9 +782,8 @@ ATIAssignVGA outb(VGA_DAC_MASK, 0xA5U); if (inb(IBM_DAC_MASK) == 0xA5U) pATI->VGAAdapter = ATI_ADAPTER_VGA; + outb(VGA_DAC_MASK, OldDACMask); } - - outb(VGA_DAC_MASK, OldDACMask); } break; @@ -825,10 +803,9 @@ ATIAssignVGA outb(VGA_DAC_MASK, 0xA5U); if (inb(IBM_DAC_MASK) == 0xA5U) pATI->VGAAdapter = ATI_ADAPTER_VGA; + outb(VGA_DAC_MASK, OldDACMask); } - outb(VGA_DAC_MASK, OldDACMask); - if (ClockSel & DISABPASSTHRU) outw(CLOCK_SEL, ClockSel); } @@ -854,10 +831,9 @@ ATIAssignVGA outb(VGA_DAC_MASK, 0xA5U); if (inb(IBM_DAC_MASK) == 0xA5U) pATI->VGAAdapter = ATI_ADAPTER_MACH32; + outb(VGA_DAC_MASK, OldDACMask); } - outb(VGA_DAC_MASK, OldDACMask); - if (ClockSel & DISABPASSTHRU) outw(CLOCK_SEL, ClockSel); if (MiscOptions & (DISABLE_VGA | DISABLE_DAC)) @@ -879,10 +855,9 @@ ATIAssignVGA outb(VGA_DAC_MASK, 0xA5U); if (in8(M64_DAC_MASK) == 0xA5U) pATI->VGAAdapter = ATI_ADAPTER_MACH64; + outb(VGA_DAC_MASK, OldDACMask); } - outb(VGA_DAC_MASK, OldDACMask); - if (!(DACCntl & DAC_VGA_ADR_EN)) outr(DAC_CNTL, DACCntl); } @@ -927,6 +902,8 @@ ATIAssignVGA xf86MsgVerb(X_INFO, 3, ATI_NAME ": VGA assigned to this adapter.\n"); } +#ifndef AVOID_NON_PCI + /* * ATIClaimVGA -- * @@ -955,6 +932,8 @@ ATIClaimVGA ATIClaimSparseIOBases(ProbeFlags, pATI->CPIO_VGAWonder, 2, Detected); } +#endif /* AVOID_NON_PCI */ + /* * ATIFindVGA -- * @@ -1217,6 +1196,8 @@ ATIProbe xfree(PCIPorts); +#ifndef AVOID_NON_PCI + /* * A note on probe strategy. I/O and memory response by certain PCI * devices has been disabled by the common layer at this point, @@ -1328,6 +1309,9 @@ ATIProbe ATIClaimSparseIOBases(ProbeFlags, Mach64SparseIOBases[i], 4, DetectedMach64); } + +#endif /* AVOID_NON_PCI */ + } #endif /* AVOID_CPIO */ @@ -1370,7 +1354,7 @@ ATIProbe "Unshared PCI sparse I/O Mach64 in slot %d:%d:%d", pVideo->bus, pVideo->device, pVideo->func); xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s detected through Block 0 at 0x%08X.\n", + ATI_NAME ": %s detected through Block 0 at 0x%08lX.\n", Identifier, pATI->Block0Base); AddAdapter(pATI); pATI->PCIInfo = pVideo; @@ -1493,6 +1477,8 @@ ATIProbe pVideo->bus, pVideo->device, pVideo->func); break; +#ifndef AVOID_NON_PCI + case Detected8514A: if ((p8514->BusType >= ATI_BUS_PCI) && !p8514->PCIInfo) p8514->PCIInfo = pVideo; @@ -1514,6 +1500,8 @@ ATIProbe pVideo->bus, pVideo->device, pVideo->func); break; +#endif /* AVOID_NON_PCI */ + default: /* Must be DoProbe */ if (!xf86CheckPciSlot(pVideo->bus, pVideo->device, @@ -1587,6 +1575,8 @@ ATIProbe pVideo->bus, pVideo->device, pVideo->func); break; +#ifndef AVOID_NON_PCI + case Detected8514A: xf86Msg(X_WARNING, ATI_NAME ": PCI Mach64 in slot %d:%d:%d will not" @@ -1610,6 +1600,8 @@ ATIProbe Mach64SparseIOBases[j]); break; +#endif /* AVOID_NON_PCI */ + default: /* Must be DoProbe */ if (!xf86CheckPciSlot(pVideo->bus, pVideo->device, @@ -1689,7 +1681,7 @@ ATIProbe sprintf(Identifier, "Shared PCI Mach64 in slot %d:%d:%d", pVideo->bus, pVideo->device, pVideo->func); xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s with Block 0 base 0x%08X detected.\n", + ATI_NAME ": %s with Block 0 base 0x%08lX detected.\n", Identifier, pATI->Block0Base); AddAdapter(pATI); pATI->SharedAccelerator = TRUE; @@ -1724,43 +1716,12 @@ ATIProbe Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); if (Chip > ATI_CHIP_Mach64) { - switch (Chip) - { - case ATI_CHIP_RAGE128GL: - case ATI_CHIP_RAGE128VR: - case ATI_CHIP_RAGE128PROULTRA: - case ATI_CHIP_RAGE128PROGL: - case ATI_CHIP_RAGE128PROVR: - case ATI_CHIP_RAGE128MOBILITY3: - case ATI_CHIP_RAGE128MOBILITY4: - DoRage128 = TRUE; - continue; - - case ATI_CHIP_RADEON: - case ATI_CHIP_RADEONVE: - case ATI_CHIP_RADEONMOBILITY6: - case ATI_CHIP_RS100: - case ATI_CHIP_RS200: - case ATI_CHIP_RS250: - case ATI_CHIP_RADEONMOBILITY7: - case ATI_CHIP_R200: - case ATI_CHIP_RV200: - case ATI_CHIP_RV250: - case ATI_CHIP_RADEONMOBILITY9: - case ATI_CHIP_RS300: - case ATI_CHIP_RV280: - case ATI_CHIP_RADEONMOBILITY9PLUS: - case ATI_CHIP_R300: - case ATI_CHIP_RV350: - case ATI_CHIP_R350: - case ATI_CHIP_R360: - DoRadeon = TRUE; - continue; + if (Chip <= ATI_CHIP_Rage128) + DoRage128 = TRUE; + else if (Chip <= ATI_CHIP_Radeon) + DoRadeon = TRUE; - case ATI_CHIP_HDTV: - default: - continue; - } + continue; } if (!nATIGDev) @@ -2313,18 +2274,7 @@ NoVGAWonder:; ATIPtrs[j - 1] = NULL; /* Fill in probe data */ - pScreenInfo->driverVersion = ATI_VERSION_CURRENT; - pScreenInfo->driverName = ATI_DRIVER_NAME; - pScreenInfo->name = ATI_NAME; - pScreenInfo->Probe = ATIProbe; - pScreenInfo->PreInit = ATIPreInit; - pScreenInfo->ScreenInit = ATIScreenInit; - pScreenInfo->SwitchMode = ATISwitchMode; - pScreenInfo->AdjustFrame = ATIAdjustFrame; - pScreenInfo->EnterVT = ATIEnterVT; - pScreenInfo->LeaveVT = ATILeaveVT; - pScreenInfo->FreeScreen = ATIFreeScreen; - pScreenInfo->ValidMode = ATIValidMode; + ATIFillInScreenInfo(pScreenInfo); pScreenInfo->driverPrivate = pATI; diff --git a/src/r128_driver.c b/src/r128_driver.c index 3a92dc09..ce2a1026 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -138,7 +138,7 @@ typedef enum { OPTION_SHOW_CACHE } R128Opts; -const OptionInfoRec R128Options[] = { +static const OptionInfoRec R128Options[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE }, @@ -165,6 +165,8 @@ const OptionInfoRec R128Options[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; +OptionInfoRec *R128OptionsWeak(void) { return R128Options; } + R128RAMRec R128RAM[] = { /* Memory Specifications From RAGE 128 Software Development Manual (Technical Reference Manual P/N @@ -1919,9 +1921,9 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) if (!xf86LoadSubModule(pScrn, "fbdevhw")) return FALSE; xf86LoaderReqSymLists(fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn, info->PciInfo, NULL)) return FALSE; - pScrn->SwitchMode = fbdevHWSwitchMode; - pScrn->AdjustFrame = fbdevHWAdjustFrame; - pScrn->ValidMode = fbdevHWValidMode; + pScrn->SwitchMode = LoaderSymbol("fbdevHWSwitchMode"); + pScrn->AdjustFrame = LoaderSymbol("fbdevHWAdjustFrame"); + pScrn->ValidMode = LoaderSymbol("fbdevHWValidMode"); } if (!info->FBDev) @@ -2425,7 +2427,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Colormap setup */ if (!miCreateDefColormap(pScreen)) return FALSE; if (!xf86HandleColormaps(pScreen, 256, info->dac6bits ? 6 : 8, - (info->FBDev ? fbdevHWLoadPalette : + (info->FBDev ? LoaderSymbol("fbdevHWLoadPalette") : R128LoadPalette), NULL, CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH @@ -2436,7 +2438,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* DPMS setup - FIXME: also for mirror mode in non-fbdev case? - Michel */ if (info->FBDev) - xf86DPMSInit(pScreen, fbdevHWDPMSSet, 0); + xf86DPMSInit(pScreen, LoaderSymbol("fbdevHWDPMSSet"), 0); else { if (!info->HasPanelRegs || info->BIOSDisplay == R128_BIOS_DISPLAY_CRT) xf86DPMSInit(pScreen, R128DisplayPowerManagementSet, 0); @@ -3674,4 +3676,19 @@ static int r128_set_backlight_enable(ScrnInfoPtr pScrn, int on) OUTREG(R128_LVDS_GEN_CNTL, lvds_gen_cntl); return 0; - } +} + +void R128FillInScreenInfo(ScrnInfoPtr pScrn) +{ + pScrn->driverVersion = R128_VERSION_CURRENT; + pScrn->driverName = R128_DRIVER_NAME; + pScrn->name = R128_NAME; + pScrn->PreInit = R128PreInit; + pScrn->ScreenInit = R128ScreenInit; + pScrn->SwitchMode = R128SwitchMode; + pScrn->AdjustFrame = R128AdjustFrame; + pScrn->EnterVT = R128EnterVT; + pScrn->LeaveVT = R128LeaveVT; + pScrn->FreeScreen = R128FreeScreen; + pScrn->ValidMode = R128ValidMode; +} diff --git a/src/r128_probe.c b/src/r128_probe.c index a5cd42fe..a138ec56 100644 --- a/src/r128_probe.c +++ b/src/r128_probe.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.18 2003/02/09 15:33:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.17 2003/02/07 20:41:15 martin Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -48,32 +48,6 @@ #include "xf86_ansic.h" #include "xf86Resources.h" -#ifdef XFree86LOADER - -/* - * The following exists to prevent the compiler from considering entry points - * defined in a separate module from being constants. - */ -static xf86PreInitProc * const volatile PreInitProc = R128PreInit; -static xf86ScreenInitProc * const volatile ScreenInitProc = R128ScreenInit; -static xf86SwitchModeProc * const volatile SwitchModeProc = R128SwitchMode; -static xf86AdjustFrameProc * const volatile AdjustFrameProc = R128AdjustFrame; -static xf86EnterVTProc * const volatile EnterVTProc = R128EnterVT; -static xf86LeaveVTProc * const volatile LeaveVTProc = R128LeaveVT; -static xf86FreeScreenProc * const volatile FreeScreenProc = R128FreeScreen; -static xf86ValidModeProc * const volatile ValidModeProc = R128ValidMode; - -#define R128PreInit PreInitProc -#define R128ScreenInit ScreenInitProc -#define R128SwitchMode SwitchModeProc -#define R128AdjustFrame AdjustFrameProc -#define R128EnterVT EnterVTProc -#define R128LeaveVT LeaveVTProc -#define R128FreeScreen FreeScreenProc -#define R128ValidMode ValidModeProc - -#endif - SymTabRec R128Chipsets[] = { /* FIXME: The chipsets with (PCI/AGP) are not known wether they are AGP or * PCI, so I've labeled them as such in hopes users will submit @@ -194,7 +168,7 @@ R128AvailableOptions(int chipid, int busid) chipid -= PCI_VENDOR_ATI << 16; for (i = 0; R128PciChipsets[i].PCIid > 0; i++) { if (chipid == R128PciChipsets[i].PCIid) - return R128Options; + return R128OptionsWeak(); } return NULL; } @@ -280,18 +254,8 @@ R128Probe(DriverPtr drv, int flags) #endif - pScrn->driverVersion = R128_VERSION_CURRENT; - pScrn->driverName = R128_DRIVER_NAME; - pScrn->name = R128_NAME; pScrn->Probe = R128Probe; - pScrn->PreInit = R128PreInit; - pScrn->ScreenInit = R128ScreenInit; - pScrn->SwitchMode = R128SwitchMode; - pScrn->AdjustFrame = R128AdjustFrame; - pScrn->EnterVT = R128EnterVT; - pScrn->LeaveVT = R128LeaveVT; - pScrn->FreeScreen = R128FreeScreen; - pScrn->ValidMode = R128ValidMode; + R128FillInScreenInfo(pScrn); foundScreen = TRUE; diff --git a/src/r128_probe.h b/src/r128_probe.h index 094a9b69..aa4c547f 100644 --- a/src/r128_probe.h +++ b/src/r128_probe.h @@ -69,10 +69,14 @@ extern void R128LeaveVT FunctionPrototype((int, int)); extern void R128FreeScreen FunctionPrototype((int, int)); -extern int R128ValidMode +extern ModeStatus R128ValidMode FunctionPrototype((int, DisplayModePtr, Bool, int)); -extern const OptionInfoRec R128Options[]; +extern OptionInfoRec * R128OptionsWeak + FunctionPrototype((void)); + +extern void R128FillInScreenInfo + FunctionPrototype((ScrnInfoPtr)); #endif /* _R128_PROBE_H_ */ diff --git a/src/radeon_accel.c b/src/radeon_accel.c index c91c5cc8..b111530b 100644 --- a/src/radeon_accel.c +++ b/src/radeon_accel.c @@ -111,8 +111,6 @@ static struct { { RADEON_ROP3_ONE, RADEON_ROP3_ONE } /* GXset */ }; -extern int gRADEONEntityIndex; - /* The FIFO has 64 slots. This routines waits until at least `entries' * of these slots are empty. */ diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 5bcbb82d..11c05d0d 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -165,7 +165,7 @@ typedef enum { OPTION_DYNAMIC_CLOCKS } RADEONOpts; -const OptionInfoRec RADEONOptions[] = { +static const OptionInfoRec RADEONOptions[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE }, @@ -210,6 +210,8 @@ const OptionInfoRec RADEONOptions[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; +OptionInfoRec *RADEONOptionsWeak(void) { return RADEONOptions; } + static const char *vgahwSymbols[] = { "vgaHWFreeHWRec", "vgaHWGetHWRec", @@ -439,7 +441,7 @@ static const RADEONTMDSPll default_tmds_pll[CHIP_FAMILY_LAST][4] = {{15000, 0xb0155}, {0xffffffff, 0xb01cb}, {0, 0}, {0, 0}}, /*CHIP_FAMILY_RV350*/ }; -extern int gRADEONEntityIndex; +extern int getRADEONEntityIndex(void); struct RADEONInt10Save { CARD32 MEM_CNTL; @@ -455,7 +457,7 @@ static RADEONEntPtr RADEONEntPriv(ScrnInfoPtr pScrn) DevUnion *pPriv; RADEONInfoPtr info = RADEONPTR(pScrn); pPriv = xf86GetEntityPrivate(info->pEnt->index, - gRADEONEntityIndex); + getRADEONEntityIndex()); return pPriv->ptr; } @@ -4152,7 +4154,7 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) xf86LoaderReqSymLists(fbdevHWSymbols, NULL); if (fbdevHWInit(pScrn, info->PciInfo, NULL)) { - pScrn->ValidMode = fbdevHWValidMode; + pScrn->ValidMode = LoaderSymbol("fbdevHWValidMode"); info->FBDev = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using framebuffer device\n"); @@ -8060,3 +8062,20 @@ static void RADEONSetDynamicClock(ScrnInfoPtr pScrn, int mode) } } +void RADEONFillInScreenInfo(ScrnInfoPtr pScrn) +{ + pScrn->driverVersion = RADEON_VERSION_CURRENT; + pScrn->driverName = RADEON_DRIVER_NAME; + pScrn->name = RADEON_NAME; + pScrn->PreInit = RADEONPreInit; + pScrn->ScreenInit = RADEONScreenInit; + pScrn->SwitchMode = RADEONSwitchMode; +#ifdef X_XF86MiscPassMessage + pScrn->HandleMessage = RADEONHandleMessage; +#endif + pScrn->AdjustFrame = RADEONAdjustFrame; + pScrn->EnterVT = RADEONEnterVT; + pScrn->LeaveVT = RADEONLeaveVT; + pScrn->FreeScreen = RADEONFreeScreen; + pScrn->ValidMode = RADEONValidMode; +} diff --git a/src/radeon_probe.c b/src/radeon_probe.c index 5dade637..e1396501 100644 --- a/src/radeon_probe.c +++ b/src/radeon_probe.c @@ -49,39 +49,6 @@ #include "xf86misc.h" #include "xf86Resources.h" -#ifdef XFree86LOADER - -/* - * The following exists to prevent the compiler from considering entry points - * defined in a separate module from being constants. - */ -static xf86PreInitProc *const volatile PreInitProc = RADEONPreInit; -static xf86ScreenInitProc *const volatile ScreenInitProc = RADEONScreenInit; -static xf86SwitchModeProc *const volatile SwitchModeProc = RADEONSwitchMode; -static xf86AdjustFrameProc *const volatile AdjustFrameProc = RADEONAdjustFrame; -static xf86EnterVTProc *const volatile EnterVTProc = RADEONEnterVT; -static xf86LeaveVTProc *const volatile LeaveVTProc = RADEONLeaveVT; -static xf86FreeScreenProc *const volatile FreeScreenProc = RADEONFreeScreen; -static xf86ValidModeProc *const volatile ValidModeProc = RADEONValidMode; -#ifdef X_XF86MiscPassMessage -static xf86HandleMessageProc *const volatile HandleMessageProc - = RADEONHandleMessage; -#endif - -#define RADEONPreInit PreInitProc -#define RADEONScreenInit ScreenInitProc -#define RADEONSwitchMode SwitchModeProc -#define RADEONAdjustFrame AdjustFrameProc -#define RADEONEnterVT EnterVTProc -#define RADEONLeaveVT LeaveVTProc -#define RADEONFreeScreen FreeScreenProc -#define RADEONValidMode ValidModeProc -#ifdef X_XF86MiscPassMessage -# define RADEONHandleMessage HandleMessageProc -#endif - -#endif - SymTabRec RADEONChipsets[] = { { PCI_CHIP_RADEON_QD, "ATI Radeon QD (AGP)" }, { PCI_CHIP_RADEON_QE, "ATI Radeon QE (AGP)" }, @@ -220,6 +187,8 @@ PciChipsets RADEONPciChipsets[] = { int gRADEONEntityIndex = -1; +const int getRADEONEntityIndex(void) { return gRADEONEntityIndex; } + /* Return the options for supported chipset 'n'; NULL otherwise */ const OptionInfoRec * RADEONAvailableOptions(int chipid, int busid) @@ -234,7 +203,7 @@ RADEONAvailableOptions(int chipid, int busid) chipid -= PCI_VENDOR_ATI << 16; for (i = 0; RADEONPciChipsets[i].PCIid > 0; i++) { if (chipid == RADEONPciChipsets[i].PCIid) - return RADEONOptions; + return RADEONOptionsWeak(); } return NULL; } @@ -317,21 +286,8 @@ RADEONProbe(DriverPtr drv, int flags) xf86LoaderReqSymLists(RADEONSymbols, NULL); #endif - pScrn->driverVersion = RADEON_VERSION_CURRENT; - pScrn->driverName = RADEON_DRIVER_NAME; - pScrn->name = RADEON_NAME; pScrn->Probe = RADEONProbe; - pScrn->PreInit = RADEONPreInit; - pScrn->ScreenInit = RADEONScreenInit; - pScrn->SwitchMode = RADEONSwitchMode; -#ifdef X_XF86MiscPassMessage - pScrn->HandleMessage = RADEONHandleMessage; -#endif - pScrn->AdjustFrame = RADEONAdjustFrame; - pScrn->EnterVT = RADEONEnterVT; - pScrn->LeaveVT = RADEONLeaveVT; - pScrn->FreeScreen = RADEONFreeScreen; - pScrn->ValidMode = RADEONValidMode; + RADEONFillInScreenInfo(pScrn); foundScreen = TRUE; } diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 77d7e86c..b3666ebf 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.11 2003/07/02 17:31:30 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.13 2003/10/30 17:37:00 tsi Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -60,9 +60,9 @@ typedef struct ScrnInfoPtr pPrimaryScrn; int MonType1; - int MonType2; + int MonType2; xf86MonPtr MonInfo1; - xf86MonPtr MonInfo2; + xf86MonPtr MonInfo2; Bool ReversedDAC; /* TVDAC used as primary dac */ Bool ReversedTMDS; /* DDC_DVI is used for external TMDS */ } RADEONEntRec, *RADEONEntPtr; @@ -100,10 +100,14 @@ extern void RADEONLeaveVT FunctionPrototype((int, int)); extern void RADEONFreeScreen FunctionPrototype((int, int)); -extern int RADEONValidMode +extern ModeStatus RADEONValidMode FunctionPrototype((int, DisplayModePtr, Bool, int)); -extern const OptionInfoRec RADEONOptions[]; +extern OptionInfoRec * RADEONOptionsWeak + FunctionPrototype((void)); + +extern void RADEONFillInScreenInfo + FunctionPrototype((ScrnInfoPtr)); #endif /* _RADEON_PROBE_H_ */ diff --git a/src/radeon_video.c b/src/radeon_video.c index 08d3c296..2e754895 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -21,8 +21,6 @@ #define TIMER_MASK (OFF_TIMER | FREE_TIMER) -extern int gRADEONEntityIndex; - static void RADEONInitOffscreenImages(ScreenPtr); static XF86VideoAdaptorPtr RADEONSetupImageVideo(ScreenPtr); |