void show_animation_line(UINT32 index,UINT32 capacity_grids){ UINT32 logonum; UINT32 logolen; UINT32 inaddr; UINT32 i; void *fb_addr = mt65xx_get_fb_addr(); UINT32 fb_size = mt65xx_get_fb_size(); void *db_addr = mt65xx_get_logo_db_addr(); unsigned int *pinfo = (unsigned int*)db_addr; logonum = pinfo[0]; printf("[ChargingAnimation]show_animation_line :index= %d, logonum = %d\n", index, logonum); //ASSERT(index < logonum); if(index < logonum) logolen = pinfo[3+index] - pinfo[2+index]; else logolen = pinfo[1] - pinfo[2+index]; inaddr = (unsigned int)db_addr+pinfo[2+index]; printf("[ChargingAnimation]show_animation_line, in_addr=0x%08x, dest_addr=0x%08x, logolen=%d, ticks=%d\n", inaddr, logolen, logolen, get_ticks()); //windows draw default 160 180, mt65xx_logo_decompress((void*)inaddr, (void*)line_pic_addr, logolen, line_pic_size); printf("[ChargingAnimation]show_animation_line :line_pic_size= %d, line_pic_addr size = %d\n", line_pic_size, sizeof(line_pic_addr)); fill_line_flow(battery_rect.left, capacity_grids, battery_rect.right, battery_rect.bottom, line_pic_addr); }
// number_position: 0~1st number, 1~2nd number ,2~% void show_animation_number(UINT32 index,UINT32 number_position){ UINT32 logonum; UINT32 logolen; UINT32 inaddr; UINT32 i; void *fb_addr = mt65xx_get_fb_addr(); UINT32 fb_size = mt65xx_get_fb_size(); void *db_addr = mt65xx_get_logo_db_addr(); unsigned int *pinfo = (unsigned int*)db_addr; logonum = pinfo[0]; printf("[ChargingAnimation]show_animation_number :index= %d, logonum = %d\n", index, logonum); //ASSERT(index < logonum); if(index < logonum) logolen = pinfo[3+index] - pinfo[2+index]; else logolen = pinfo[1] - pinfo[2+index]; inaddr = (unsigned int)db_addr+pinfo[2+index]; printf("[ChargingAnimation]show_animation_number, in_addr=0x%08x, dest_addr=0x%08x, logolen=%d, ticks=%d\n", inaddr, logolen, logolen, get_ticks()); //windows draw default 160 180, mt65xx_logo_decompress((void*)inaddr, (void*)number_pic_addr, logolen, number_pic_size); fill_rect_flow(number_location_rect.left+ number_pic_width*number_position, number_location_rect.top, number_location_rect.right+number_pic_width*number_position, number_location_rect.bottom,number_pic_addr); //mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT); }
/******************************************************* * Routine: misc_init_r * Description: Init ethernet (done here so udelay works) ********************************************************/ int misc_init_r (void) { int ret = 0; #ifdef CFG_UBOOT_PROFILING unsigned int time_load_logo; unsigned int time_boot_mode; unsigned int time_part_init; #endif #ifdef CFG_UBOOT_PROFILING time_part_init = get_timer(0); #endif mt6575_part_init(BLK_NUM(16 * GB)); // mt6575_part_dump(); #ifdef CFG_UBOOT_PROFILING printf("[PROFILE] ------- part_init takes %d ms -------- \n", get_timer(time_part_init)); #endif //***************** //* check mode (1) factory mode (2) meta mode ... #ifdef CFG_UBOOT_PROFILING time_boot_mode = get_timer(0); #endif boot_mode_select(); #ifdef CFG_UBOOT_PROFILING printf("[PROFILE] ------- boot mode select takes %d ms -------- \n", get_timer(time_boot_mode)); #endif #if 1 //Remove tmp for 6575 porting #ifdef CONFIG_MMC mmc_legacy_init(1); mt6575_part_dump(); #endif #ifdef CFG_UBOOT_PROFILING time_load_logo = get_timer(0); #endif ret = mboot_common_load_logo((unsigned long)mt65xx_get_logo_db_addr(), CFG_LOGO_NAME); printf("Show BLACK_PICTURE\n"); mt65xx_disp_fill_rect(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT, 0x0); mt65xx_disp_power(TRUE); mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT); #ifdef CFG_UBOOT_PROFILING printf("[PROFILE] ------- load_logo takes %d ms -------- \n", get_timer(time_load_logo)); #endif if (ret <= 0) { printf("[ERROR] load logo partition failed, ret: %d\n", ret); } return 0; #endif//Remove tmp for 6575 porting }
// this is a sample code for how to draw the logo by yourself. void cust_show_boot_logo(void) { void *fb_addr = mt65xx_get_fb_addr(); UINT32 fb_size = mt65xx_get_fb_size(); void *db_addr = mt65xx_get_logo_db_addr(); memcpy(fb_addr, (UINT32)db_addr + fb_size * 0, fb_size); mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT); }
void show_animation(UINT32 index, RECT rect, char* addr){ UINT32 logonum; UINT32 logolen; UINT32 inaddr; UINT32 i; void *fb_addr = mt65xx_get_fb_addr(); UINT32 fb_size = mt65xx_get_fb_size(); void *db_addr = mt65xx_get_logo_db_addr(); unsigned int *pinfo = (unsigned int*)db_addr; logonum = pinfo[0]; printf("[ChargingAnimation]show_animation : index = %d, logonum = %d\n", index, logonum); //ASSERT(index < logonum); printf("[ChargingAnimation]show_animation :pinfo[0] = %d, pinfo[1] = %d, pinfo[2]= %d, pinfo[3] = %d\n",pinfo[0] , pinfo[1],pinfo[2],pinfo[3]); printf("[ChargingAnimation]show_animation :pinfo[2+index] = %d, pinfo[1] = %d\n",pinfo[2+index] , pinfo[3+index]); if(index < logonum) logolen = pinfo[3+index] - pinfo[2+index]; else logolen = pinfo[1] - pinfo[2+index]; inaddr = (unsigned int)db_addr+pinfo[2+index]; printf("[ChargingAnimation]show_animation: in_addr=0x%08x, dest_addr=0x%08x, logolen=%d, ticks=%d\n", inaddr, logolen, logolen, get_ticks()); mt65xx_logo_decompress((void*)inaddr, (void*)addr, logolen, (rect.right-rect.left)*(rect.bottom-rect.top)*2); printf("[ChargingAnimation]show_animation : rect right = %d\n", rect.right); printf("[ChargingAnimation]show_animation : rect top = %d\n", rect.top); printf("[ChargingAnimation]show_animation : rect size = %d\n", (rect.right-rect.left)*(rect.bottom-rect.top)*2); fill_rect_flow(rect.left,rect.top,rect.right,rect.bottom,addr); printf("ticks=%d\n", get_ticks()); }
static void show_logo(UINT32 index) { UINT32 logonum; UINT32 logolen; UINT32 inaddr; void *fb_addr = mt65xx_get_fb_addr(); UINT32 fb_size = mt65xx_get_fb_size(); void *db_addr = mt65xx_get_logo_db_addr(); unsigned int *pinfo = (unsigned int*)db_addr; logonum = pinfo[0]; ASSERT(index < logonum); if(index < logonum) logolen = pinfo[3+index] - pinfo[2+index]; else logolen = pinfo[1] - pinfo[2+index]; inaddr = (unsigned int)db_addr+pinfo[2+index]; printf("show_logo, in_addr=0x%08x, fb_addr=0x%08x, logolen=%d, ticks=%d\n", inaddr, fb_addr, logolen, get_ticks()); // mt65xx_logo_decompress((void*)inaddr, (void*)fb_addr + 2 * fb_size, logolen, fb_size); #if 1 { unsigned short *d; int j,k; if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "270", 3)) { unsigned int l; unsigned short *s; unsigned int width = CFG_DISPLAY_WIDTH; unsigned int height = CFG_DISPLAY_HEIGHT; mt65xx_logo_decompress((void*)inaddr, (void*)fb_addr + 2 * fb_size, logolen, fb_size); s = fb_addr + 2 * fb_size; for (j=0; j<width; j++){ for (k=0, l=height-1; k<height; k++, l--) { d = fb_addr + ((ALIGN_TO(width, 32) * l + j) << 1); *d = *s++; } } } else if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "90", 2)) { unsigned int l; unsigned short *s; unsigned int width = CFG_DISPLAY_WIDTH; unsigned int height = CFG_DISPLAY_HEIGHT; mt65xx_logo_decompress((void*)inaddr, (void*)fb_addr + 2 * fb_size, logolen, fb_size); s = fb_addr + 2 * fb_size; for (j=width - 1; j>=0; j--){ for (k=0, l=0; k<height; k++, l++) { d = fb_addr + ((ALIGN_TO(width, 32) * l + j) << 1); *d = *s++; } } } else #endif { if(0 != CFG_DISPLAY_WIDTH % 32){ unsigned short *s; unsigned short *d; unsigned int width = CFG_DISPLAY_WIDTH; unsigned int height = CFG_DISPLAY_HEIGHT; mt65xx_logo_decompress((void*)inaddr, (void*)fb_addr + 2 * fb_size, logolen, fb_size); s = fb_addr + 2 * fb_size; d = fb_addr; for (j=0;j < height; j++){ { memcpy(d, s, width * 2); d += ALIGN_TO(width, 32); s += width; } } } else{ mt65xx_logo_decompress((void*)inaddr, (void*)fb_addr, logolen, fb_size); } } } printf("ticks=%d\n", get_ticks()); }