// 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);
}
Beispiel #2
0
static void mt_disp_adjusting_hardware_addr(void)
{
    printf("[wwy] mt_disp_adjusting_hardware_addr fb_offset_logo = %d\n",fb_offset_logo);
    if(fb_offset_logo == 0)
    {
        mt_get_fb_addr();
        memcpy(fb_addr,(void *)((UINT32)fb_addr + 3 * fb_size),fb_size);
        mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
    }
}
Beispiel #3
0
/*
 * Fill rectangle region for with black  or other color  
 *
 */
void mt_disp_fill_rect(UINT32 left, UINT32 top,
                           UINT32 right, UINT32 bottom,
                           UINT32 color)
{
    dprintf(INFO, "[lk logo: %s %d]\n",__FUNCTION__,__LINE__);   
    init_fb_screen();
    RECT_REGION_T rect = {left, top, right, bottom};
    
    fill_rect_with_color(mt_get_fb_addr(), rect, color, phical_screen);     
}
Beispiel #4
0
static void fill_rect_flow2(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom, char *addr)
{
    void * fb_addr = mt_get_fb_addr();
    const UINT32 WIDTH = ALIGN_TO(CFG_DISPLAY_WIDTH,32);

    UINT16 *pLine = (UINT16 *)fb_addr + top * WIDTH + left;
	
    INT32 x, y;
	INT32 i = 0;
	UINT16 *pLine2 = (UINT16*)addr;
    for (y = top; y < bottom; ++ y) {
        UINT16 *pPixel = pLine;
        for (x = left; x < right; ++ x) {
	*pPixel++ = pLine2[i++];
        }
        pLine += WIDTH;
    }
}
Beispiel #5
0
/*
 * Show charging over logo
 *
 */
void mt_disp_show_charger_ov_logo(void)
{
    dprintf(INFO, "[lk logo: %s %d]\n",__FUNCTION__,__LINE__);
    mt_logo_get_custom_if();

    if(logo_cust_if->show_boot_logo)
    {
        logo_cust_if->show_boot_logo();
    }
    else
    {
        init_fb_screen();
        fill_animation_logo(CHARGER_OV_INDEX, mt_get_fb_addr(), mt_get_tempfb_addr(), logo_addr, phical_screen);
        mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
    }

    return;
}
Beispiel #6
0
/*
 * Show animation when poweroff charging
 *
 */
void mt_disp_show_battery_capacity(UINT32 capacity)
{
        dprintf(INFO, "[lk logo: %s %d]capacity =%d\n",__FUNCTION__,__LINE__, capacity);
    mt_logo_get_custom_if();

    if(logo_cust_if->show_battery_capacity)
    {
        logo_cust_if->show_battery_capacity(capacity);
    }
    else
    {     
        init_fb_screen();
        
        fill_animation_battery_by_ver(capacity, mt_get_fb_addr(), mt_get_tempfb_addr(), logo_addr, phical_screen, show_animationm_ver);            
                  
        mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
    }

}
Beispiel #7
0
void mt_disp_fill_rect(UINT32 left, UINT32 top,
                           UINT32 right, UINT32 bottom,
                           UINT32 color)
{
    void * fb_addr = mt_get_fb_addr();
    const UINT32 WIDTH = ALIGN_TO(CFG_DISPLAY_WIDTH, 32);
	const UINT32 HEIGHT = CFG_DISPLAY_HEIGHT;
    const UINT16 COLOR = (UINT16)color;

    UINT16 *pLine;
    INT32 x, y;
	pLine = (UINT16 *)fb_addr + top * WIDTH + left;
#if 1
	if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "270", 3))
	{
		unsigned int l;
        UINT16 *d = fb_addr;
		
		for (x=top; x<bottom; x++){
	  		for (y=left, l= HEIGHT - left; y<right; y++, l--)
	    	{
				d = fb_addr + ((WIDTH * l + x) << 1);
				*d = COLOR;
	    	}
		}
	}
	else if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "90", 2))
	{
		unsigned int l;
        UINT16 *d = fb_addr;
		for (x=WIDTH - top + 1; x > WIDTH - bottom; x--){
			for (y=left, l=left; y<right; y++, l++)
		   	{
				d = fb_addr + ((WIDTH * l + x) << 1);
				*d = COLOR;
		   	}
		}
	}
    else if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "180", 3))
        {
            unsigned int height = (bottom - top);
            unsigned int width = (right - left);
        	UINT16 *d = (UINT16 *)fb_addr + (HEIGHT - bottom) * WIDTH + (WIDTH - right);
        	//UINT16 *pLine2 = (UINT16*)addr;
           for (y = 0; y < height; ++ y) {
              for (x = 0; x < width; ++ x) {
                  *(d+x) = COLOR;
              }
              d += WIDTH;
           }
        }
	else
#endif
	{
    	for (y = top; y < bottom; ++ y) {
        	UINT16 *pPixel = pLine;
        	for (x = left; x < right; ++ x) {
            	*pPixel++ = COLOR;
        	}
        	pLine += WIDTH;
    	}
	}
}
Beispiel #8
0
static void fill_line_flow(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom, char *addr)
{
    void * fb_addr = mt_get_fb_addr();
    const UINT32 WIDTH = ALIGN_TO(CFG_DISPLAY_WIDTH,32);
    const UINT32 HEIGHT = CFG_DISPLAY_HEIGHT;
    UINT16 *pLine = (UINT16 *)fb_addr + top * WIDTH + left;
    UINT16 *pLine2 = (UINT16*)addr;		
    INT32 x, y;
    INT32 i = 0;
    if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "270", 3))
	{
	unsigned int l;
        UINT16 *d = fb_addr;
		for (x=top; x<bottom; x++) {
	  		for (y=left, l= HEIGHT - left; y<right; y++, l--)
	    	        {
				d = fb_addr + ((WIDTH * l + x) << 1);
				*d = pLine2[i++];
	    	        }
                    i = 0;
		}
	}
    else if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "90", 2))
	{
        unsigned int l;
        UINT16 *d = fb_addr;
		for (x=WIDTH - top + 1; x > WIDTH - bottom; x--) {
			for (y=left, l=left; y<right; y++, l++)
		   	{
				d = fb_addr + ((WIDTH * l + x) << 1);
				*d = pLine2[i++];
		   	}
                    i = 0;
		}
	}
    else if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "180", 3))
        {
            unsigned int height = (bottom - top);
            unsigned int width = (right - left);
        	UINT16 *s = (UINT16*)addr + (2 * ((height - 1) * width));
        	UINT16 *d = (UINT16 *)fb_addr + (HEIGHT - bottom) * WIDTH + (WIDTH - right);
        	//UINT16 *pLine2 = (UINT16*)addr;
           for (y = 0; y < height; ++ y) {
              for (x = 0; x < width; ++ x) {
                *(d+x) = *(s+width-x);
              }
              d += WIDTH;
              s -= width;
           }
        }
   else 
        {
           for (y = top; y < bottom; ++ y) {
              UINT16 *pPixel = pLine;
              for (x = left; x < right; ++ x) {
		*pPixel++ = pLine2[i++];
              }
              pLine += WIDTH;
              i = 0;
           }
        }
}
Beispiel #9
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());
}