Example #1
0
void show_animation_line(UINT32 index,UINT32 capacity_grids){
	UINT32 logonum;
	UINT32 logolen;
	UINT32 inaddr;
	UINT32 i;
		
	//void  *fb_addr = mt_get_fb_addr();
        UINT32 fb_size = mt_get_fb_size();
        void  *db_addr = mt_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,
	mt_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);
	
}
Example #2
0
// 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 = mt_get_fb_addr();
        UINT32 fb_size = mt_get_fb_size();
        void  *db_addr = mt_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,
	mt_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);

	//mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
}
Example #3
0
/*
 * Initliaze charging animation parameters 
 *
 */
void init_fb_screen()
{
    dprintf(INFO, "[lk logo: %s %d]\n",__FUNCTION__,__LINE__);
    unsigned int fb_size = mt_get_fb_size();
    logo_addr = mt_get_logo_db_addr();

    phical_screen.width = CFG_DISPLAY_WIDTH;
    phical_screen.height = CFG_DISPLAY_HEIGHT;
    phical_screen.fb_size = fb_size;   
    phical_screen.fill_dst_bits = MTK_FB_ALIGNMENT;   
        
    // in JB2.MP need to allign width and height to 32 ,but jb5.mp needn't   
    phical_screen.needAllign = 1;
    phical_screen.allignWidth = ALIGN_TO(CFG_DISPLAY_WIDTH, MTK_FB_ALIGNMENT);
    
    /* In GB, no need to adjust 180 showing logo ,for fb driver dealing the change */
    /* but in JB, need adjust it for screen 180 roration           */
    phical_screen.need180Adjust = 0;   // need sync with chip driver 
    
    dprintf(INFO, "[lk logo: %s %d]MTK_LCM_PHYSICAL_ROTATION = %s\n",__FUNCTION__,__LINE__, MTK_LCM_PHYSICAL_ROTATION);

    if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "270", 3))
    { 
        phical_screen.rotation = 270;
    } else if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "90", 2)){ 
        phical_screen.rotation = 90;
    } else if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "180", 3) && (phical_screen.need180Adjust == 1)){ 
        phical_screen.rotation = 180;   
    } else {
        phical_screen.rotation = 0;   
    }
    
    sync_anim_version();
    if (show_animationm_ver == 1)
    {
        unsigned int logonum;
        unsigned int *db_addr = logo_addr;
    
        unsigned int *pinfo = (unsigned int*)db_addr;
        
        logonum = pinfo[0];
        dprintf(INFO, "[lk logo: %s %d]pinfo[0]=0x%08x, pinfo[1]=0x%08x, pinfo[2]=%d\n", __FUNCTION__,__LINE__,
                    pinfo[0], pinfo[1], pinfo[2]);
    
        dprintf(INFO, "[lk logo: %s %d]define ANIMATION_NEW:show new animation with capacity num\n",__FUNCTION__,__LINE__); 
        dprintf(INFO, "[lk logo: %s %d]CAPACITY_LEFT =%d, CAPACITY_TOP =%d \n",__FUNCTION__,__LINE__,(CAPACITY_LEFT) ,(CAPACITY_TOP) ); 
        dprintf(INFO, "[lk logo: %s %d]LCM_HEIGHT=%d, LCM_WIDTH=%d \n",__FUNCTION__,__LINE__,(CAPACITY_RIGHT),(CAPACITY_BOTTOM)); 
        if(logonum < 6)
        {
            show_animationm_ver = 0 ;
        } else {
            show_animationm_ver = 1 ;   
        }
    }
    
}
// this is a sample code for how to draw the logo by yourself.
void cust_show_boot_logo(void)
{
    void  *fb_addr = mt_get_fb_addr();
    UINT32 fb_size = mt_get_fb_size();
    void  *db_addr = mt_get_logo_db_addr();

    memcpy(fb_addr, (void *)((UINT32)db_addr + fb_size * 0), fb_size);

    mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
}
Example #5
0
void show_animation(UINT32 index, RECT rect, char* addr){
	        UINT32 logonum;
		UINT32 logolen;
		UINT32 inaddr;
		UINT32 i;
		
                //void  *fb_addr = mt_get_fb_addr();
                UINT32 fb_size = mt_get_fb_size();
                void  *db_addr = mt_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());
	
		mt_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());
		
	}
Example #6
0
static void show_logo(UINT32 index)
{
	UINT32 logonum;
    UINT32 logolen;
	UINT32 inaddr;
    void  *fb_addr = mt_get_fb_addr();
    void  *fb_tempaddr = mt_get_tempfb_addr();
    UINT32 fb_size = mt_get_fb_size();
    void  *db_addr = mt_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());
//    mt_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;
			mt_logo_decompress((void*)inaddr, fb_tempaddr, logolen, fb_size);
			s = fb_tempaddr;
			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;
			mt_logo_decompress((void*)inaddr, fb_tempaddr, logolen, fb_size);
			s = fb_tempaddr;
			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 if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "180", 2))
		{
			unsigned short *s;
			unsigned short *d;
			unsigned int width = CFG_DISPLAY_WIDTH;
			unsigned int height = CFG_DISPLAY_HEIGHT;
			mt_logo_decompress((void*)inaddr, fb_tempaddr, logolen, fb_size);
			s = fb_tempaddr + (2 * ((height - 1) * width));
			d = fb_addr;
			for (j=0;j < height; j++){
	    		{
	    		    for (k=0;k < width; k++)
	    		    {
	    		        *(d+k) = *(s+width-k);
	    		    }
					//memcpy(d, s, width * 2);
					d += ALIGN_TO(width, 32);
					s -= width;
	    		}
			}
		}
		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;
				mt_logo_decompress((void*)inaddr, fb_tempaddr, logolen, fb_size);
				s = fb_tempaddr;
				d = fb_addr;
				for (j=0;j < height; j++){
		    		{
						memcpy(d, s, width * 2);
						d += ALIGN_TO(width, 32);
						s += width;
		    		}
				}
			}
			else{
				mt_logo_decompress((void*)inaddr, (void*)fb_addr, logolen, fb_size); 
			}
		}
	}
    printf("ticks=%d\n", get_ticks());
}