summaryrefslogtreecommitdiff
path: root/src/r128_probe.c
diff options
context:
space:
mode:
authorAlex Deucher <agd5f@yahoo.com>2004-12-19 19:49:33 +0000
committerAlex Deucher <agd5f@yahoo.com>2004-12-19 19:49:33 +0000
commit7c7b278883676412f5709cf812587b1408628133 (patch)
tree657a95ceb0d6daf6dac429edc818f902d204450b /src/r128_probe.c
parent08a45118b53129f3b9c30004404b906c7d7690be (diff)
- Add support for Dualhead on M3/M4 (bug 1760)
Diffstat (limited to 'src/r128_probe.c')
-rw-r--r--src/r128_probe.c50
1 files changed, 43 insertions, 7 deletions
diff --git a/src/r128_probe.c b/src/r128_probe.c
index 08b3595a..85ba6416 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -101,6 +101,8 @@ PciChipsets R128PciChipsets[] = {
{ -1, -1, RES_UNDEFINED }
};
+int gR128EntityIndex = -1;
+
/* Return the options for supported chipset 'n'; NULL otherwise */
const OptionInfoRec *
R128AvailableOptions(int chipid, int busid)
@@ -137,7 +139,6 @@ R128Probe(DriverPtr drv, int flags)
int numDevSections, nATIGDev, nR128GDev;
int *usedChips;
GDevPtr *devSections, *ATIGDevs, *R128GDevs;
- EntityInfoPtr pEnt;
Bool foundScreen = FALSE;
int i;
@@ -183,10 +184,13 @@ R128Probe(DriverPtr drv, int flags)
if (flags & PROBE_DETECT)
foundScreen = TRUE;
else for (i = 0; i < numUsed; i++) {
- pEnt = xf86GetEntityInfo(usedChips[i]);
-
- if (pEnt->active) {
- ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
+ ScrnInfoPtr pScrn;
+ EntityInfoPtr pEnt;
+
+ pScrn = NULL;
+ if((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
+ R128PciChipsets, 0, 0, 0, 0, 0)))
+ {
#ifdef XFree86LOADER
@@ -206,11 +210,43 @@ R128Probe(DriverPtr drv, int flags)
foundScreen = TRUE;
- xf86ConfigActivePciEntity(pScrn, usedChips[i], R128PciChipsets,
- 0, 0, 0, 0, 0);
+ pEnt = xf86GetEntityInfo(usedChips[i]);
+
+ /* mobility cards support Dual-Head, mark the entity as sharable*/
+ if(pEnt->chipset == PCI_CHIP_RAGE128LE ||
+ pEnt->chipset == PCI_CHIP_RAGE128LF ||
+ pEnt->chipset == PCI_CHIP_RAGE128MF ||
+ pEnt->chipset == PCI_CHIP_RAGE128ML)
+ {
+ static int instance = 0;
+ DevUnion* pPriv;
+
+ xf86SetEntitySharable(usedChips[i]);
+ xf86SetEntityInstanceForScreen(pScrn,
+ pScrn->entityList[0], instance);
+
+ if(gR128EntityIndex < 0)
+ {
+ gR128EntityIndex = xf86AllocateEntityPrivateIndex();
+ pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
+ gR128EntityIndex);
+
+ if (!pPriv->ptr)
+ {
+ R128EntPtr pR128Ent;
+ pPriv->ptr = xnfcalloc(sizeof(R128EntRec), 1);
+ pR128Ent = pPriv->ptr;
+ pR128Ent->IsDRIEnabled = FALSE;
+ pR128Ent->BypassSecondary = FALSE;
+ pR128Ent->HasSecondary = FALSE;
+ pR128Ent->IsSecondaryRestored = FALSE;
+ }
+ }
+ instance++;
}
xfree(pEnt);
}
+ }
xfree(usedChips);
xfree(devSections);