add proper memory size unit handling across all driver supported cards
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41526 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -109,12 +109,19 @@ radeon_hd_init(radeon_info &info)
|
||||
info.shared_info->has_edid = false;
|
||||
}
|
||||
|
||||
// Read R6XX memory size into shared info
|
||||
info.shared_info->graphics_memory_size
|
||||
= read32(info.registers + R6XX_CONFIG_MEMSIZE) >> 10;
|
||||
// Populate graphics_memory_size with graphics memory size in 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) * 1024;
|
||||
} else {
|
||||
// R600-R700 has memory stored in bytes
|
||||
info.shared_info->graphics_memory_size
|
||||
= read32(info.registers + R6XX_CONFIG_MEMSIZE) >> 10;
|
||||
}
|
||||
|
||||
TRACE("card(%ld): found %ld KB memory on card.\n", info.id,
|
||||
info.shared_info->graphics_memory_size);
|
||||
TRACE("card(%ld): found %ld MB memory on card.\n", info.id,
|
||||
info.shared_info->graphics_memory_size / 1024);
|
||||
|
||||
TRACE("card(%ld): %s completed successfully!\n", info.id, __func__);
|
||||
return B_OK;
|
||||
|
||||
Reference in New Issue
Block a user