switch bios reading over

This commit is contained in:
Dave Airlie
2008-01-16 13:34:58 +10:00
parent ef98280b03
commit 585e03e687

View File

@@ -4219,7 +4219,6 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Could not allocate memory for video BIOS image\n");
} else {
ULong segstart;
UShort mypciid = pSiS->Chipset;
UShort mypcivendor = (pSiS->ChipFlags & SiSCF_IsXGI) ? PCI_VENDOR_XGI : PCI_VENDOR_SIS;
Bool found = FALSE, readpci = FALSE;
@@ -4242,7 +4241,15 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
biossize = 0x8000;
break;
}
#if XSERVER_LIBPCIACCESS
if(readpci) {
pSiS->PciInfo->rom_size = biossize;
pci_device_read_rom(pSiS->PciInfo, pSiS->BIOS);
if(SISCheckBIOS(pSiS, mypciid, mypcivendor, biossize)) {
found = TRUE;
}
}
#else
if(readpci) {
xf86ReadPciBIOS(0, pSiS->PciTag, 0, pSiS->BIOS, biossize);
if(SISCheckBIOS(pSiS, mypciid, mypcivendor, biossize)) {
@@ -4251,6 +4258,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
}
if(!found) {
ULong segstart;
for(segstart = BIOS_BASE; segstart < 0x000f0000; segstart += 0x00001000) {
#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
@@ -4265,7 +4273,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
break;
}
}
#endif
if(found) {
UShort romptr = pSiS->BIOS[0x16] | (pSiS->BIOS[0x17] << 8);
pSiS->SiS_Pr->VirtualRomBase = pSiS->BIOS;