UINT32 DISP_GetVRamSizeBoot(char *cmdline) { static UINT32 vramSize = 0; if(vramSize) { return vramSize; } disp_get_lcm_name_boot(cmdline); // if can't get the lcm type from uboot, we will return 0x800000 for a safe value if(disp_drv) vramSize = disp_drv->get_vram_size(); else { printk("%s, can't get lcm type, reserved memory size will be set as 0x800000\n", __func__); return 0x800000; } // Align vramSize to 1MB // vramSize = ALIGN_TO_POW_OF_2(vramSize, 0x100000); printk("DISP_GetVRamSizeBoot: %u bytes[%dMB]\n", vramSize, (vramSize>>20)); return vramSize; }
UINT32 DISP_GetVRamSize(void) { // Use a local static variable to cache the calculated vram size // static UINT32 vramSize = 0; if (0 == vramSize) { disp_drv_init_context(); vramSize = disp_drv->get_vram_size(); // Align vramSize to 1MB // vramSize = ALIGN_TO_POW_OF_2(vramSize, 0x100000); //printf("DISP_GetVRamSize: %u bytes\n", vramSize); } return vramSize; }