diff options
author | James Cloos <cloos@jhcloos.com> | 2007-09-03 06:07:32 -0400 |
---|---|---|
committer | James Cloos <cloos@jhcloos.com> | 2007-09-03 06:07:32 -0400 |
commit | 6fde3fd6d34e7252ee16422b19896d71b1622039 (patch) | |
tree | f14ab2b9dd93d9097d5f2c8a4085ee2b81a6f7fc /src/mga_bios.c | |
parent | 4bfc1e1ea11604e3af150a4228663cb1cb1bf9f3 (diff) | |
parent | 923176f5aad777b4023003a457bb77da21373389 (diff) |
Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga
Diffstat (limited to 'src/mga_bios.c')
-rw-r--r-- | src/mga_bios.c | 15 |
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; |