read and store aperture size (will be used in fblocation calculations)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41543 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f3c3902ce1
commit
6c43ea6336
@ -76,6 +76,7 @@ struct radeon_shared_info {
|
||||
uint8* graphics_memory;
|
||||
addr_t physical_graphics_memory;
|
||||
uint32 graphics_memory_size;
|
||||
uint32 graphics_aperture_size;
|
||||
|
||||
bool has_edid;
|
||||
edid1_info edid_info;
|
||||
@ -145,6 +146,9 @@ struct radeon_free_graphics_memory {
|
||||
uint32 buffer_base;
|
||||
};
|
||||
|
||||
// registers
|
||||
#define R6XX_CONFIG_APER_SIZE 0x5430 // r600>
|
||||
#define OLD_CONFIG_APER_SIZE 0x0108 // <r600
|
||||
|
||||
// cursor
|
||||
#define RADEON_CURSOR_CONTROL 0x70080
|
||||
|
@ -38,8 +38,6 @@ create_mode_list(void)
|
||||
const color_space kRadeonHDSpaces[] = {B_RGB32_LITTLE, B_RGB24_LITTLE,
|
||||
B_RGB16_LITTLE, B_RGB15_LITTLE, B_CMAP8};
|
||||
|
||||
// TODO : Read EDID for create_display_modes via AtomBios as well
|
||||
|
||||
gInfo->mode_list_area = create_display_modes("radeon HD modes",
|
||||
gInfo->shared_info->has_edid ? &gInfo->shared_info->edid_info : NULL,
|
||||
NULL, 0, kRadeonHDSpaces,
|
||||
|
@ -109,19 +109,31 @@ radeon_hd_init(radeon_info &info)
|
||||
info.shared_info->has_edid = false;
|
||||
}
|
||||
|
||||
// Populate graphics_memory_size with graphics memory size in KB
|
||||
// Populate graphics_memory/aperture_size with KB
|
||||
if (info.shared_info->device_chipset >= RADEON_R800) {
|
||||
// R800+ has memory stored in MB
|
||||
info.shared_info->graphics_memory_size
|
||||
= read32(info.registers + R6XX_CONFIG_MEMSIZE) << 10;
|
||||
info.shared_info->graphics_aperture_size
|
||||
= read32(info.registers + R6XX_CONFIG_APER_SIZE) << 10;
|
||||
} else {
|
||||
// R600-R700 has memory stored in bytes
|
||||
info.shared_info->graphics_memory_size
|
||||
= read32(info.registers + R6XX_CONFIG_MEMSIZE) >> 10;
|
||||
info.shared_info->graphics_aperture_size
|
||||
= read32(info.registers + R6XX_CONFIG_APER_SIZE) >> 10;
|
||||
}
|
||||
|
||||
TRACE("card(%ld): found %ld MB memory on card.\n", info.id,
|
||||
info.shared_info->graphics_memory_size / 1024);
|
||||
info.shared_info->graphics_memory_size >> 10);
|
||||
TRACE("card(%ld): found %ld MB aperture on card.\n", info.id,
|
||||
info.shared_info->graphics_aperture_size >> 10);
|
||||
|
||||
// if there are more then 512MB memory on the card, only map
|
||||
// the aperture size to prevent overflow of gart
|
||||
if (info.shared_info->graphics_memory_size > 524288)
|
||||
info.shared_info->graphics_memory_size
|
||||
= info.shared_info->graphics_aperture_size;
|
||||
|
||||
TRACE("card(%ld): %s completed successfully!\n", info.id, __func__);
|
||||
return B_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user