* add card instance to accelerant shared info

* when TRACE_ATOM is enabled in bios.c, we dump
  each accelerant instance of the AtomBIOS rom
  to disk in /boot/common/cache/tmp/ (next to usb
  hid descriptors in the same file name format)
* these images can be parsed with the AtomDis application


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42622 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV 2011-08-11 05:17:34 +00:00
parent f1383bbf4d
commit a823207363
4 changed files with 37 additions and 0 deletions

View File

@ -75,6 +75,7 @@ struct overlay_registers;
struct radeon_shared_info {
uint32 device_index; // accelerant index
uint32 device_id; // device pciid
area_id mode_list_area; // area containing display mode list
uint32 mode_count;

View File

@ -69,6 +69,10 @@ radeon_init_bios(uint8* bios)
return B_ERROR;
}
#ifdef TRACE_ATOM
radeon_dump_bios();
#endif
struct card_info *atom_card_info
= (card_info*)malloc(sizeof(card_info));
@ -119,3 +123,33 @@ radeon_init_bios(uint8* bios)
return B_OK;
}
status_t
radeon_dump_bios()
{
// For debugging use, dump card AtomBIOS
radeon_shared_info &info = *gInfo->shared_info;
TRACE("%s: Dumping AtomBIOS as ATOM_DEBUG is set...\n",
__func__);
FILE* fp;
char filename[255];
sprintf(filename, "/boot/common/cache/tmp/radeon_hd_bios_1002_%" B_PRIx32
"_%" B_PRIu32 ".bin", info.device_id, info.device_index);
fp = fopen(filename, "wb");
if (fp == NULL) {
TRACE("%s: Cannot create AtomBIOS blob at %s\n", __func__, filename);
return B_ERROR;
}
fwrite(gInfo->rom, info.rom_size, 1, fp);
fclose(fp);
TRACE("%s: AtomBIOS dumped to %s\n", __func__, filename);
return B_OK;
}

View File

@ -15,6 +15,7 @@
status_t radeon_init_bios(uint8* bios);
status_t radeon_dump_bios();
#endif /* RADEON_HD_BIOS_H */

View File

@ -375,6 +375,7 @@ radeon_hd_init(radeon_info &info)
frambufferMapper.Detach();
// Pass common information to accelerant
info.shared_info->device_index = info.id;
info.shared_info->device_id = info.device_id;
info.shared_info->device_chipset = info.device_chipset;
info.shared_info->registers_area = info.registers_area;