* create area for AtomBIOS
* clone mapped AtomBIOS area into accelerant git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42560 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -73,6 +73,7 @@ struct radeon_shared_info {
|
||||
uint32 mode_count;
|
||||
|
||||
bool has_rom; // was rom mapped?
|
||||
area_id rom_area; // area of mapped rom
|
||||
uint32 rom_phys; // rom base location
|
||||
uint32 rom_size; // rom size
|
||||
uint8* rom; // cloned, memory mapped PCI ROM
|
||||
|
||||
@@ -156,6 +156,16 @@ init_common(int device, bool isClone)
|
||||
return status;
|
||||
}
|
||||
|
||||
gInfo->rom_area = clone_area("radeon hd AtomBIOS",
|
||||
(void **)&gInfo->rom, B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA,
|
||||
gInfo->shared_info->rom_area);
|
||||
|
||||
if (gInfo->rom_area < 0)
|
||||
TRACE("%s: Clone of AtomBIOS failed!\n", __func__);
|
||||
|
||||
if (gInfo->rom[0] != 0x55 || gInfo->rom[0] != 0xAA)
|
||||
TRACE("%s: didn't find a VGA bios in cloned region!\n", __func__);
|
||||
|
||||
sharedCloner.Keep();
|
||||
regsCloner.Keep();
|
||||
|
||||
@@ -176,6 +186,7 @@ uninit_common(void)
|
||||
if (gInfo != NULL) {
|
||||
delete_area(gInfo->regs_area);
|
||||
delete_area(gInfo->shared_info_area);
|
||||
delete_area(gInfo->rom_area);
|
||||
|
||||
gInfo->regs_area = gInfo->shared_info_area = -1;
|
||||
|
||||
@@ -213,7 +224,7 @@ radeon_init_accelerant(int device)
|
||||
init_lock(&info.accelerant_lock, "radeon hd accelerant");
|
||||
init_lock(&info.engine_lock, "radeon hd engine");
|
||||
|
||||
radeon_init_bios(info.rom);
|
||||
radeon_init_bios(gInfo->rom);
|
||||
|
||||
status = detect_displays();
|
||||
//if (status != B_OK)
|
||||
|
||||
@@ -36,6 +36,9 @@ struct accelerant_info {
|
||||
display_mode *mode_list; // cloned list of standard display modes
|
||||
area_id mode_list_area;
|
||||
|
||||
uint8* rom;
|
||||
area_id rom_area;
|
||||
|
||||
edid1_info edid_info;
|
||||
bool has_edid;
|
||||
|
||||
|
||||
@@ -110,13 +110,13 @@ radeon_hd_getbios(radeon_info &info)
|
||||
result = B_ERROR;
|
||||
} else {
|
||||
TRACE("%s: found a valid VGA bios!\n", __func__);
|
||||
info.shared_info->rom = (uint8*)malloc(rom_size);
|
||||
if (info.shared_info->rom == NULL) {
|
||||
info.atom_buffer = (uint8*)malloc(rom_size);
|
||||
if (info.atom_buffer == NULL) {
|
||||
dprintf(DEVICE_NAME ": failed to clone atombios!\n");
|
||||
result = B_ERROR;
|
||||
} else {
|
||||
memcpy(info.shared_info->rom, (void *)bios, rom_size);
|
||||
if (isAtomBIOS(info.shared_info->rom)) {
|
||||
memcpy(info.atom_buffer, (void *)bios, rom_size);
|
||||
if (isAtomBIOS(info.atom_buffer)) {
|
||||
dprintf(DEVICE_NAME ": AtomBIOS found and mapped!\n");
|
||||
result = B_OK;
|
||||
} else {
|
||||
@@ -263,7 +263,15 @@ radeon_hd_init(radeon_info &info)
|
||||
}
|
||||
|
||||
// *** VGA rom / AtomBIOS mapping
|
||||
status_t foundRom = radeon_hd_getbios_r600(info);
|
||||
status_t biosStatus = radeon_hd_getbios_r600(info);
|
||||
|
||||
// *** AtomBIOS mapping
|
||||
info.rom_area = create_area("radeon hd AtomBIOS",
|
||||
(void **)&info.atom_buffer, B_ANY_KERNEL_ADDRESS,
|
||||
info.shared_info->rom_size, B_READ_AREA | B_WRITE_AREA, B_NO_LOCK);
|
||||
|
||||
if (info.rom_area < 0)
|
||||
dprintf("%s: failed to create kernel AtomBIOS area!\n", __func__);
|
||||
|
||||
// Turn on write combining for the area
|
||||
vm_set_area_memory_type(info.framebuffer_area,
|
||||
@@ -284,7 +292,8 @@ radeon_hd_init(radeon_info &info)
|
||||
= read32(info.registers + R6XX_CONFIG_FB_BASE);
|
||||
|
||||
// populate VGA rom info into shared_info
|
||||
info.shared_info->has_rom = (foundRom == B_OK) ? true : false;
|
||||
info.shared_info->has_rom = (biosStatus == B_OK) ? true : false;
|
||||
info.shared_info->rom_area = info.rom_area;
|
||||
|
||||
// Copy device name into shared_info
|
||||
strcpy(info.shared_info->device_identifier, info.device_identifier);
|
||||
@@ -349,6 +358,5 @@ radeon_hd_uninit(radeon_info &info)
|
||||
delete_area(info.shared_area);
|
||||
delete_area(info.registers_area);
|
||||
delete_area(info.framebuffer_area);
|
||||
delete_area(info.rom_area);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@ struct radeon_info {
|
||||
int32 id;
|
||||
pci_info* pci;
|
||||
uint8* registers;
|
||||
|
||||
uint8* atom_buffer; // buffer for atombios
|
||||
|
||||
area_id registers_area;
|
||||
area_id framebuffer_area;
|
||||
area_id rom_area;
|
||||
|
||||
Reference in New Issue
Block a user