diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2007-12-24 11:56:19 -0700 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-01-03 17:41:18 -0700 |
commit | f1482feb5b210095c564e2cad5bfd6d6e4e2cd78 (patch) | |
tree | 5b2a59280c2211b45f4a292d8137a28bb702fa4b | |
parent | d4cd5d91a015088d548736831edd31760bcda88d (diff) |
[LX] Re-arrange PreInit to avoid segfaults in Xorg -configure
Re-arrange the early part of PreInit so that Xorg -configure can run
cleanly.
-rw-r--r-- | src/amd_lx_driver.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/amd_lx_driver.c b/src/amd_lx_driver.c index 7efda1f..08a7e51 100644 --- a/src/amd_lx_driver.c +++ b/src/amd_lx_driver.c @@ -470,39 +470,45 @@ LXPreInit(ScrnInfoPtr pScrni, int flags) { GeodePtr pGeode; ClockRangePtr GeodeClockRange; + EntityInfoPtr pEnt; OptionInfoRec *GeodeOptions = &LX_GeodeOptions[0]; rgb defaultWeight = { 0, 0, 0 }; int modecnt; char *s, *panelgeo = NULL; + Bool useVGA; - pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1); + if (pScrni->numEntities != 1) + return FALSE; - if (pGeode == NULL) - return FALSE; + pEnt = xf86GetEntityInfo(pScrni->entityList[0]); - /* Probe for VGA */ - pGeode->useVGA = TRUE; - pGeode->VGAActive = FALSE; + if (pEnt->resources) + return FALSE; + + useVGA = LXCheckVGA(pScrni); + + if (flags & PROBE_DETECT) { + if (useVGA) + GeodeProbeDDC(pScrni, pEnt->index); - if (xf86LoadSubModule(pScrni, "vgahw")) { - if (vgaHWGetHWRec(pScrni)) - pGeode->useVGA = LXCheckVGA(pScrni); + return TRUE; } - if (pGeode->useVGA) - pGeode->vesa = xcalloc(sizeof(VESARec), 1); + pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1); - if (pScrni->numEntities != 1) - return FALSE; + if (pGeode == NULL) + return FALSE; - pGeode->pEnt = xf86GetEntityInfo(pScrni->entityList[0]); + pGeode->useVGA = useVGA; + pGeode->VGAActive = FALSE; + pGeode->pEnt = pEnt; - if (pGeode->pEnt->resources) - return FALSE; + if (pGeode->useVGA) { + if (!xf86LoadSubModule(pScrni, "vgahw") || + !vgaHWGetHWRec(pScrni)) + pGeode->useVGA = FALSE; - if (pGeode->useVGA && (flags & PROBE_DETECT)) { - GeodeProbeDDC(pScrni, pGeode->pEnt->index); - return TRUE; + pGeode->vesa = xcalloc(sizeof(VESARec), 1); } cim_rdmsr = LXReadMSR; |