r128_accel.c | 4 ++-- r128_driver.c | 29 ++++++++++++++++++++++------- radeon_driver.c | 17 ++++++++++++++++- radeon_probe.c | 2 -- 4 files changed, 40 insertions(+), 12 deletions(-) Index: r128_accel.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c,v retrieving revision 1.6 diff -u -d -p -r1.6 r128_accel.c --- r128_accel.c 11 Jul 2005 02:29:45 -0000 1.6 +++ r128_accel.c 30 Nov 2005 04:44:44 -0000 @@ -122,7 +122,7 @@ static struct { { R128_ROP3_ONE, R128_ROP3_ONE } /* GXset */ }; -extern int gR128EntityIndex; +extern int getR128EntityIndex(void); /* Flush all dirty data in the Pixel Cache to memory. */ void R128EngineFlush(ScrnInfoPtr pScrn) @@ -1842,7 +1842,7 @@ static void R128MMIOAccelInit(ScrnInfoPt DevUnion* pPriv; R128EntPtr pR128Ent; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; /*if there are more than one devices sharing this entity, we Index: r128_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v retrieving revision 1.21 diff -u -d -p -r1.21 r128_driver.c --- r128_driver.c 26 Aug 2005 07:00:24 -0000 1.21 +++ r128_driver.c 30 Nov 2005 04:44:45 -0000 @@ -372,14 +372,29 @@ void R128LoaderRefSymLists(void) NULL); } +#ifdef XFree86LOADER +int getR128EntityIndex(void) +{ + int *r128_entity_index = LoaderSymbol("gR128EntityIndex"); + if (!r128_entity_index) + return -1; + else + return *r128_entity_index; +} +#else extern int gR128EntityIndex; +int getR128EntityIndex(void) +{ + return gR128EntityIndex; +} +#endif R128EntPtr R128EntPriv(ScrnInfoPtr pScrn) { DevUnion *pPriv; R128InfoPtr info = R128PTR(pScrn); pPriv = xf86GetEntityPrivate(info->pEnt->index, - gR128EntityIndex); + getR128EntityIndex()); return pPriv->ptr; } @@ -665,7 +680,7 @@ static Bool R128GetBIOSParameters(ScrnIn DevUnion* pPriv; R128EntPtr pR128Ent; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; pR128Ent->HasSecondary = TRUE; @@ -689,7 +704,7 @@ static Bool R128GetBIOSParameters(ScrnIn DevUnion* pPriv; R128EntPtr pR128Ent; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; pR128Ent->BypassSecondary = TRUE; } @@ -2054,7 +2069,7 @@ _X_EXPORT Bool R128PreInit(ScrnInfoPtr p R128EntPtr pR128Ent; info->IsSecondary = TRUE; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; if(pR128Ent->BypassSecondary) return FALSE; pR128Ent->pSecondaryScrn = pScrn; @@ -2066,7 +2081,7 @@ _X_EXPORT Bool R128PreInit(ScrnInfoPtr p info->IsPrimary = TRUE; xf86SetPrimInitDone(pScrn->entityList[0]); pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; pR128Ent->pPrimaryScrn = pScrn; pR128Ent->IsDRIEnabled = FALSE; @@ -2410,7 +2425,7 @@ _X_EXPORT Bool R128ScreenInit(int scrnIn DevUnion* pPriv; R128EntPtr pR128Ent; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; pR128Ent->IsDRIEnabled = info->directRenderingEnabled; } @@ -3111,7 +3126,7 @@ static void R128RestoreMode(ScrnInfoPtr } pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; Index: radeon_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v retrieving revision 1.82 diff -u -d -p -r1.82 radeon_driver.c --- radeon_driver.c 8 Nov 2005 14:05:00 -0000 1.82 +++ radeon_driver.c 30 Nov 2005 04:44:47 -0000 @@ -521,7 +521,22 @@ static const RADEONTMDSPll default_tmds_ {{0xffffffff, 0xb01cb}, {0, 0}, {0, 0}, {0, 0}}, /*CHIP_FAMILY_R420*/ }; -extern int getRADEONEntityIndex(void); +#ifdef XFree86LOADER +static int getRADEONEntityIndex(void) +{ + int *radeon_entity_index = LoaderSymbol("gRADEONEntityIndex"); + if (!radeon_entity_index) + return -1; + else + return *radeon_entity_index; +} +#else +extern int gRADEONEntityIndex; +static int getRADEONEntityIndex(void) +{ + return gRADEONEntityIndex; +} +#endif struct RADEONInt10Save { CARD32 MEM_CNTL; Index: radeon_probe.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v retrieving revision 1.11 diff -u -d -p -r1.11 radeon_probe.c --- radeon_probe.c 11 Jul 2005 02:29:45 -0000 1.11 +++ radeon_probe.c 30 Nov 2005 04:44:47 -0000 @@ -195,8 +195,6 @@ 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)