[Xorg-driver-geode] Geode LX video testing results
Jordan Crouse
jordan.crouse at amd.com
Mon Dec 24 09:58:35 PST 2007
On 24/12/07 10:16 -0500, Gideon Romm wrote:
> 2. Geode GX2, GSW BIOS: X does not start and fails with the Backtrace
> first noted in the launchpad bug.
By popular request - here's a patch to try to fix that (compile tested,
not tested on hardware - I don't have a GX within reach).
Jordan
-------------- next part --------------
[GX] Fix the autoconfigure segfault for GX too
From: Jordan Crouse <jordan.crouse at amd.com>
---
src/amd_gx_driver.c | 63 +++++++++++++++++++++++++++------------------------
1 files changed, 33 insertions(+), 30 deletions(-)
diff --git a/src/amd_gx_driver.c b/src/amd_gx_driver.c
index 30047ea..b555c77 100644
--- a/src/amd_gx_driver.c
+++ b/src/amd_gx_driver.c
@@ -368,17 +368,19 @@ GXMapMem(ScrnInfoPtr pScrni)
static Bool
GXCheckVGA(ScrnInfoPtr pScrni) {
- const char *vgasig = "IBM VGA Compatible";
- vgaHWPtr pvgaHW = VGAHWPTR(pScrni);
- int ret;
+ unsigned char *ptr;
+ const char *vgasig = "IBM VGA Compatible";
+ int ret;
- if (!vgaHWMapMem(pScrni))
- return FALSE;
+ ptr = xf86MapVidMem(pScrni->scrnIndex, VIDMEM_FRAMEBUFFER, 0xC001E, strlen(vgasig));
+
+ if (ptr == NULL)
+ return FALSE;
- ret = memcmp(pvgaHW->Base + 0x1E, vgasig, strlen(vgasig));
- vgaHWUnmapMem(pScrni);
+ ret = memcmp(ptr, vgasig, strlen(vgasig));
+ xf86UnMapVidMem(pScrni->scrnIndex, (pointer) ptr, strlen(vgasig));
- return ret ? FALSE : TRUE;
+ return ret ? FALSE : TRUE;
}
static Bool
@@ -389,42 +391,43 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
OptionInfoRec *GeodeOptions = &GX_GeodeOptions[0];
int ret;
QQ_WORD msrValue;
+ EntityInfoPtr pEnt;
rgb defaultWeight = { 0, 0, 0 };
int modecnt;
char *s, *panelgeo;
+ Bool useVGA;
+
+ if (pScrni->numEntities != 1)
+ return FALSE;
+
+ pEnt = xf86GetEntityInfo(pScrni->entityList[0]);
+ if (pEnt->resources)
+ return FALSE;
pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1);
if (pGeode == NULL)
return FALSE;
- /* Probe for VGA */
- pGeode->useVGA = FALSE;
+ useVGA = GXCheckVGA(pScrni);
- if (xf86LoadSubModule(pScrni, "vgahw")) {
- if (vgaHWGetHWRec(pScrni)) {
- pGeode->useVGA = GXCheckVGA(pScrni);
- }
+ if (flags & PROBE_DETECT) {
+ if (useVGA)
+ GeodeProbeDDC(pScrni, pEnt->index);
+ return TRUE;
}
-#if INT10_SUPPORT
- if (pGeode->useVGA)
- pGeode->vesa = xcalloc(sizeof(VESARec), 1);
-#endif
-
- if (pScrni->numEntities != 1)
- return FALSE;
-
- pGeode->pEnt = xf86GetEntityInfo(pScrni->entityList[0]);
-
- if (pGeode->pEnt->resources)
- return FALSE;
+ /* Probe for VGA */
+ pGeode->useVGA = useVGA;
+ pGeode->pEnt = pEnt;
- /* ISSUE - this won't work without VGA, but its too early to know if we can use VGA or not */
+ 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;
+#if INT10_SUPPORT
+ pGeode->vesa = xcalloc(sizeof(VESARec), 1);
+#endif
}
gfx_msr_init();
More information about the Xorg-driver-geode
mailing list