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:
Alexander von Gluck IV
2011-05-16 04:43:58 +00:00
parent 2be925fd04
commit e49d783eb9
@@ -109,12 +109,19 @@ radeon_hd_init(radeon_info &info)
info.shared_info->has_edid = false; info.shared_info->has_edid = false;
} }
// Read R6XX memory size into shared info // Populate graphics_memory_size with graphics memory size in KB
info.shared_info->graphics_memory_size if (info.shared_info->device_chipset >= RADEON_R800) {
= read32(info.registers + R6XX_CONFIG_MEMSIZE) >> 10; // 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, TRACE("card(%ld): found %ld MB memory on card.\n", info.id,
info.shared_info->graphics_memory_size); info.shared_info->graphics_memory_size / 1024);
TRACE("card(%ld): %s completed successfully!\n", info.id, __func__); TRACE("card(%ld): %s completed successfully!\n", info.id, __func__);
return B_OK; return B_OK;