diff options
author | Adam Jackson <ajax@nwnk.net> | 2005-12-14 19:41:28 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2005-12-14 19:41:28 +0000 |
commit | 726fd3a81dfbd1b0c8e4ede104a48523daecab92 (patch) | |
tree | 67eeed9780c6d9510f73f9a62de22c9395f070bd /src | |
parent | 328a2d74dabe32ce35e879799412666feedb0eef (diff) |
Bug #1760: Fix ati wrapper multihead to be dlloader friendly.
Diffstat (limited to 'src')
-rw-r--r-- | src/r128_accel.c | 4 | ||||
-rw-r--r-- | src/r128_driver.c | 29 | ||||
-rw-r--r-- | src/radeon_driver.c | 17 | ||||
-rw-r--r-- | src/radeon_probe.c | 2 |
4 files changed, 40 insertions, 12 deletions
diff --git a/src/r128_accel.c b/src/r128_accel.c index 2bc4ae4..fe284e1 100644 --- a/src/r128_accel.c +++ b/src/r128_accel.c @@ -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(ScrnInfoPtr pScrn, XAAInfoRecPtr a) 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 diff --git a/src/r128_driver.c b/src/r128_driver.c index a5c0e44..58b82a6 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -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(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) DevUnion* pPriv; R128EntPtr pR128Ent; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; pR128Ent->HasSecondary = TRUE; @@ -689,7 +704,7 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) 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 pScrn, int flags) 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 pScrn, int flags) 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 scrnIndex, ScreenPtr pScreen, 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 pScrn, R128SavePtr restore) } pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gR128EntityIndex); + getR128EntityIndex()); pR128Ent = pPriv->ptr; diff --git a/src/radeon_driver.c b/src/radeon_driver.c index c6e5af2..b78322f 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -521,7 +521,22 @@ static const RADEONTMDSPll default_tmds_pll[CHIP_FAMILY_LAST][4] = {{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; diff --git a/src/radeon_probe.c b/src/radeon_probe.c index 688c1c7..aea4b73 100644 --- a/src/radeon_probe.c +++ b/src/radeon_probe.c @@ -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) |