commit c56685508b4df728231ec421ace5564aacb35333 Author: elias Date: Wed Sep 12 23:59:33 2007 +0200 Teach nv_bios.c how to locate nv50 bioses. As a side effect, NVParseBios is called later in nv_setup.c since NVDownloadBiosPRAMIN needs a valid pNv->RamAmountKBytes. diff --git a/src/nv_bios.c b/src/nv_bios.c index a29d600..fd79501 100644 --- a/src/nv_bios.c +++ b/src/nv_bios.c @@ -85,7 +85,19 @@ static void NVDownloadBiosPROM(ScrnInfoPtr pScrn, unsigned char *data) static void NVDownloadBiosPRAMIN(ScrnInfoPtr pScrn, unsigned char *data) { NVPtr pNv = NVPTR(pScrn); - const unsigned char *pramin = (void*)&pNv->REGS[0x00700000/4]; + const unsigned char *pramin; + + if (pNv->Architecture == NV_ARCH_50) { + pramin = (void*)&pNv->REGS[0x00800000/4]; + CARD32 tmp = pNv->REGS[0x00619F04/4] >> 8; + + if(tmp) + pramin -= ((pNv->RamAmountKBytes << 10) - (tmp << 16)); + else + pramin -= 0x10000; + } else { + pramin = (void*)&pNv->REGS[0x00700000/4]; + } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Attempting to locate BIOS image in PRAMIN\n"); diff --git a/src/nv_setup.c b/src/nv_setup.c index 6a00213..13d6b34 100644 --- a/src/nv_setup.c +++ b/src/nv_setup.c @@ -489,7 +489,6 @@ NVCommonSetup(ScrnInfoPtr pScrn) /* Parse the bios to initialize the card */ NVSelectHeadRegisters(pScrn, 0); - NVParseBios(pScrn); if(pNv->Architecture == NV_ARCH_04) { nv4GetConfig(pNv); @@ -497,6 +496,8 @@ NVCommonSetup(ScrnInfoPtr pScrn) nv10GetConfig(pNv); } + NVParseBios(pScrn); + if (!pNv->randr12_enable) { NVSelectHeadRegisters(pScrn, 0);