AMD's Jordan Crouse proposes the following patch.
Scott, can you apply it to the current package and see if it fixes it for you?
On 17/09/07 14:43 +0300, Martin-Éric Racine wrote: > Greetings everyone, > > Can anyone reproduce the following bug? > > https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-amd/+bug/140051
Patch is attached - just a trivial re-arranging of the first few commands in PreInit.
[LX] Re-arrange PreInit to avoid segfaults in Xorg -configure
Re-arrange the early part of PreInit so that Xorg -configure can run cleanly. ---
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 c6600d4..7dbed87 100644 --- a/src/amd_lx_driver.c +++ b/src/amd_lx_driver.c @@ -471,39 +471,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;
-- Martin-Éric Racine http://q-funk.iki.fi
AMD's Jordan Crouse proposes the following patch.
Scott, can you apply it to the current package and see if it fixes it for you?
On 17/09/07 14:43 +0300, Martin-Éric Racine wrote: /bugs.launchpad .net/ubuntu/ +source/ xserver- xorg-video- amd/+bug/ 140051
> Greetings everyone,
>
> Can anyone reproduce the following bug?
>
> https:/
Patch is attached - just a trivial re-arranging of the first few
commands in PreInit.
[LX] Re-arrange PreInit to avoid segfaults in Xorg -configure
Re-arrange the early part of PreInit so that Xorg -configure can run
cleanly.
---
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 lx_driver. c lx_driver. c ScrnInfoPtr pScrni, int flags) s[0];
index c6600d4..7dbed87 100644
--- a/src/amd_
+++ b/src/amd_
@@ -471,39 +471,45 @@ LXPreInit(
{
GeodePtr pGeode;
ClockRangePtr GeodeClockRange;
+ EntityInfoPtr pEnt;
OptionInfoRec *GeodeOptions = &LX_GeodeOption
rgb defaultWeight = { 0, 0, 0 };
int modecnt;
char *s, *panelgeo = NULL;
+ Bool useVGA;
- pGeode = pScrni- >driverPrivate = xnfcalloc( sizeof( GeodeRec) , 1); >numEntities != 1)
+ if (pScrni-
+ return FALSE;
- if (pGeode == NULL) fo(pScrni- >entityList[ 0]);
- return FALSE;
+ pEnt = xf86GetEntityIn
- /* Probe for VGA */ pScrni, pEnt->index);
- pGeode->useVGA = TRUE;
- pGeode->VGAActive = FALSE;
+ if (pEnt->resources)
+ return FALSE;
+
+ useVGA = LXCheckVGA(pScrni);
+
+ if (flags & PROBE_DETECT) {
+ if (useVGA)
+ GeodeProbeDDC(
- if (xf86LoadSubMod ule(pScrni, "vgahw")) { pScrni) )
- if (vgaHWGetHWRec(
- pGeode->useVGA = LXCheckVGA(pScrni);
+ return TRUE;
}
- if (pGeode->useVGA) sizeof( VESARec) , 1); >driverPrivate = xnfcalloc( sizeof( GeodeRec) , 1);
- pGeode->vesa = xcalloc(
+ pGeode = pScrni-
- if (pScrni- >numEntities != 1)
- return FALSE;
+ if (pGeode == NULL)
+ return FALSE;
- pGeode->pEnt = xf86GetEntityIn fo(pScrni- >entityList[ 0]);
+ pGeode->useVGA = useVGA;
+ pGeode->VGAActive = FALSE;
+ pGeode->pEnt = pEnt;
- if (pGeode- >pEnt-> resources) dule(pScrni, "vgahw") || pScrni) )
- return FALSE;
+ if (pGeode->useVGA) {
+ if (!xf86LoadSubMo
+ !vgaHWGetHWRec(
+ pGeode->useVGA = FALSE;
- if (pGeode->useVGA && (flags & PROBE_DETECT)) { pScrni, pGeode- >pEnt-> index); sizeof( VESARec) , 1);
- GeodeProbeDDC(
- return TRUE;
+ pGeode->vesa = xcalloc(
}
cim_rdmsr = LXReadMSR;
-- q-funk. iki.fi
Martin-Éric Racine
http://