summaryrefslogtreecommitdiff
path: root/src/mga_bios.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mga_bios.c')
-rw-r--r--src/mga_bios.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mga_bios.c b/src/mga_bios.c
index dd75f3f..aece217 100644
--- a/src/mga_bios.c
+++ b/src/mga_bios.c
@@ -406,15 +406,18 @@ static void mga_parse_bios_ver_5( struct mga_bios_values * bios,
Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
{
- CARD8 bios_data[0x10000];
+ CARD8 bios_data[0x20000];
unsigned offset;
MGAPtr pMga = MGAPTR(pScrn);
+#ifndef XSERVER_LIBPCIACCESS
Bool pciBIOS = TRUE;
+#endif
int rlen;
static const unsigned expected_length[] = { 0, 64, 64, 64, 128, 128 };
unsigned version;
unsigned pins_len;
const CARD8 * pins_data;
+ int err;
#ifdef BIOS_DEBUG
static const char * const host_interface_strings[8] = {
"Reserved",
@@ -443,6 +446,9 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
* might be controlled by the PCI config space.
*/
+#ifdef XSERVER_LIBPCIACCESS
+ err = pci_device_read_rom(pMga->PciInfo, bios_data);
+#else
if (pMga->BiosFrom == X_DEFAULT) {
pciBIOS = FALSE;
}
@@ -451,7 +457,7 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
}
if (pciBIOS) {
- rlen = xf86ReadPciBIOS(0, pMga->PciTag, pMga->FbBaseReg,
+ rlen = xf86ReadPciBIOS(0, pMga->PciTag, pMga->framebuffer_bar,
bios_data, sizeof(bios_data));
}
else {
@@ -459,7 +465,10 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
sizeof(bios_data), bios_data);
}
- if (rlen < (bios_data[2] << 9)) {
+ err = rlen < (bios_data[2] << 9);
+#endif
+
+ if (err) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Could not retrieve video BIOS!\n");
return FALSE;