First attempt at older Radeon card support

* add missing chipset ranges
* add a few more older (X1200) PCI ID's (mostly IGP)
* add code to detect and set frame buffer size on old chipsets
* we get to the connector detection currently and fail due to the
  lack of legacy support on my X1200 IGP
This commit is contained in:
Alexander von Gluck IV
2011-11-12 11:41:31 -06:00
parent 5ec0ede4ba
commit 0188ca92a5
3 changed files with 44 additions and 1 deletions
@@ -52,6 +52,13 @@
// Radeon Chipsets
enum radeon_chipset {
RADEON_R420 = 0, //r400, Radeon X700-X850
RADEON_R423,
RADEON_RV410,
RADEON_RS400,
RADEON_RS480,
RADEON_RS600,
RADEON_RS690,
RADEON_RS740,
RADEON_RV515,
RADEON_R520, //r500, Radeon X1300-X1950
RADEON_RV530,
@@ -55,6 +55,15 @@ const struct supported_device {
// Introduced: 2005
// Codename: Fudo
#if 0
{0x791e, 1, 0, RADEON_RS690, CHIP_IGP, "Radeon X1200"},
{0x791f, 1, 0, RADEON_RS690, CHIP_IGP, "Radeon X1200"},
{0x793f, 1, 0, RADEON_RS600, CHIP_IGP, "Radeon X1200"},
{0x7941, 1, 0, RADEON_RS600, CHIP_IGP, "Radeon X1200"},
{0x7942, 1, 0, RADEON_RS600, CHIP_IGP, "Radeon X1250"},
{0x796c, 1, 0, RADEON_RS740, CHIP_IGP, "Radeon RS740"},
{0x796d, 1, 0, RADEON_RS740, CHIP_IGP, "Radeon RS740"},
{0x796e, 1, 0, RADEON_RS740, CHIP_IGP, "Radeon 2100"},
{0x796f, 1, 0, RADEON_RS740, CHIP_IGP, "Radeon RS740"},
{0x7140, 1, 0, RADEON_RV515, CHIP_STD, "Radeon X1600"},
{0x7100, 1, 0, RADEON_R520, CHIP_STD, "Radeon X1800"},
{0x7104, 1, 0, RADEON_R520, CHIP_STD, "FireGL v7200"},
@@ -39,6 +39,13 @@
static const char radeon_chip_name[][16] = {
"R420",
"R423",
"RV410",
"RS400",
"RS480",
"RS600",
"RS690",
"RS740",
"RV515",
"R520",
"RV530",
@@ -525,10 +532,30 @@ radeon_hd_init(radeon_info &info)
// Evergreen+ has memory stored in MB
info.shared_info->graphics_memory_size
= read32(info.registers + CONFIG_MEMSIZE) * 1024;
} else {
} else if (info.chipsetID >= RADEON_R600) {
// R600-R700 has memory stored in bytes
info.shared_info->graphics_memory_size
= read32(info.registers + CONFIG_MEMSIZE) / 1024;
} else {
// R420 - R600 cards
// older cards use RADEON_CONFIG_MEMSIZE vs CONFIG_MEMSIZE
if ((info.chipsetFlags & CHIP_IGP) != 0) {
// NB_TOM holds amount of ram stolen for GPU
uint32 tom = read32(info.registers + RADEON_NB_TOM);
info.shared_info->graphics_memory_size
= (((tom >> 16) - (tom & 0xffff) + 1) << 16);
write32(info.registers + RADEON_CONFIG_MEMSIZE,
info.shared_info->graphics_memory_size);
} else {
info.shared_info->graphics_memory_size
= read32(info.registers + RADEON_CONFIG_MEMSIZE);
if (info.shared_info->graphics_memory_size == 0) {
// known bug if video memory == 8MB
info.shared_info->graphics_memory_size = 8192;
write32(info.registers + RADEON_CONFIG_MEMSIZE,
info.shared_info->graphics_memory_size * 1024);
}
}
}
uint32 barSize = info.pci->u.h0.base_register_sizes[PCI_BAR_FB] / 1024;