summaryrefslogtreecommitdiff
path: root/src/radeon_bios.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-10-04 11:32:48 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-10-04 11:32:48 +0200
commit1110957ba703475847b8e72023c6edcbd1068aef (patch)
treed07cfa64a7d9899a1057dd15c8a2293c51245a94 /src/radeon_bios.c
parent7addf41885ec5658f531624a9c24ea5bd7d22d19 (diff)
radeon: Fix for pci-rework.
Surprisingly easy, thanks to George's pci-rework changes.
Diffstat (limited to 'src/radeon_bios.c')
-rw-r--r--src/radeon_bios.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index cfa5d2b..d5b7f5e 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -48,7 +48,13 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
int tmp;
unsigned short dptr;
- if (!(info->VBIOS = xalloc(RADEON_VBIOS_SIZE))) {
+ if (!(info->VBIOS = xalloc(
+#ifdef XSERVER_LIBPCIACCESS
+ info->PciInfo->rom_size
+#else
+ RADEON_VBIOS_SIZE
+#endif
+ ))) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Cannot allocate space for hold Video BIOS!\n");
return FALSE;
@@ -58,6 +64,12 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
(void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr),
RADEON_VBIOS_SIZE);
} else {
+#ifdef XSERVER_LIBPCIACCESS
+ if (pci_device_read_rom(info->PciInfo, info->VBIOS)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Failed to read PCI ROM!\n");
+ }
+#else
xf86ReadPciBIOS(0, info->PciTag, 0, info->VBIOS, RADEON_VBIOS_SIZE);
if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -69,6 +81,7 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
xf86ReadDomainMemory(info->PciTag, info->BIOSAddr,
RADEON_VBIOS_SIZE, info->VBIOS);
}
+#endif
}
}