From 226a242731312de380f960e62e019a83ed179233 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Wed, 29 Oct 2014 10:54:14 -0500
Subject: [PATCH] radeon_hd: look at rom_base_pci vs rom_base for AtomBIOS
* Enlarge fallback shadow rom area slightly
* Hopefully should prevent failed AtomBIOS
calls due to us not mapping the wrong AtomBIOS
on some cards
---
src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp b/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp
index 5769b11..6d4cc83 100644
a
|
b
|
radeon_hd_getbios(radeon_info &info)
|
158 | 158 | if ((flags & PCI_rom_enable) != 0) |
159 | 159 | TRACE("%s: PCI ROM decode enabled\n", __func__); |
160 | 160 | |
161 | | romBase = info.pci->u.h0.rom_base; |
| 161 | romBase = info.pci->u.h0.rom_base_pci; |
162 | 162 | romSize = info.pci->u.h0.rom_size; |
163 | 163 | |
164 | 164 | if (romBase == 0 || romSize == 0) { |
… |
… |
radeon_hd_init(radeon_info &info)
|
681 | 681 | // *** very last resort, shadow bios VGA rom |
682 | 682 | ERROR("%s: Can't find an AtomBIOS rom! Trying shadow rom...\n", |
683 | 683 | __func__); |
| 684 | ERROR("%s: This can cause problems!\n", __func__); |
684 | 685 | |
685 | 686 | // This works as long as the primary card is what this driver |
686 | 687 | // is loaded for. Multiple cards may pose the risk of loading |
687 | 688 | // the wrong AtomBIOS for the wrong card. |
688 | 689 | |
| 690 | // 0xC0000 - 0xF0000 Look at ISA + BIOS Extension ROM area |
689 | 691 | uint32 romBase = 0xC0000; |
690 | | uint32 romSize = 128 * 1024; |
691 | | // what happens when AtomBIOS goes over 128Kb? |
692 | | // A Radeon HD 6990 has a 128Kb AtomBIOS |
| 692 | uint32 romSize = 192 * 1024; |
| 693 | |
| 694 | // TODO: I wonder if there is a checksum to make sure BIOS |
| 695 | // wasn't cut off? |
693 | 696 | |
694 | 697 | if (mapAtomBIOS(info, romBase, romSize) == B_OK) { |
695 | 698 | ERROR("%s: Found AtomBIOS at VGA shadow rom\n", __func__); |