Exemple #1
0
void mt_disp_init(void *lcdbase)
{
	// TODO: Fixit!!!!!
	//workaround for video mode
	//if(lcm_params->type==LCM_TYPE_DSI && lcm_params->dsi.mode!=CMD_MODE) 
	//	return;
	unsigned int lcm_fake_width = 0;
	unsigned int lcm_fake_height = 0;
	void *boot_mode_addr = 0;
    fb_size = ALIGN_TO(CFG_DISPLAY_WIDTH, MTK_FB_ALIGNMENT) * ALIGN_TO(CFG_DISPLAY_HEIGHT, MTK_FB_ALIGNMENT) * 32 / 8;
	boot_mode_addr = (void *)((UINT32)lcdbase + fb_size);
    logo_db_addr = (void *)((UINT32)lcdbase - 4 * 1024 * 1024);
//    fb_addr      = (void *)((UINT32)lcdbase + fb_size);
	fb_addr  =   lcdbase;
	fb_offset_logo = 3;

    ///for debug prupose
    disp_log_enable(1);
    dbi_log_enable(1);

	mt_disp_parse_dfo_setting();	

	if((0 == mt_disp_get_dfo_setting("LCM_FAKE_WIDTH", &lcm_fake_width)) && (0 == mt_disp_get_dfo_setting("LCM_FAKE_HEIGHT", &lcm_fake_height)))
	{
		if(DISP_STATUS_OK != DISP_Change_LCM_Resolution(lcm_fake_width, lcm_fake_height))
		{
			dprintf(INFO,"[DISP_DFO]WARNING!!! Change LCM Resolution FAILED!!!\n");
		}
	}
		
    DISP_CHECK_RET(DISP_Init((UINT32)lcdbase, (UINT32)lcdbase, FALSE));
	memset((void*)lcdbase, 0x0, DISP_GetVRamSize());
    /* transparent front buffer for fb_console display */
#if 1
    LCD_CHECK_RET(LCD_LayerEnable(FB_LAYER, TRUE));
    LCD_CHECK_RET(LCD_LayerSetAddress(FB_LAYER, (UINT32)boot_mode_addr));
    LCD_CHECK_RET(LCD_LayerSetFormat(FB_LAYER, LCD_LAYER_FORMAT_RGB565));
	LCD_CHECK_RET(LCD_LayerSetPitch(FB_LAYER, CFG_DISPLAY_WIDTH*2/*ALIGN_TO(CFG_DISPLAY_WIDTH,MTK_FB_ALIGNMENT)*2*/));
    LCD_CHECK_RET(LCD_LayerSetOffset(FB_LAYER, 0, 0));
    LCD_CHECK_RET(LCD_LayerSetSize(FB_LAYER, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT));
    LCD_CHECK_RET(LCD_LayerSetSourceColorKey(FB_LAYER, TRUE, 0xff000000));
#endif

    /* background buffer for uboot logo display */
    LCD_CHECK_RET(LCD_LayerEnable(FB_LAYER - 1, TRUE));
    LCD_CHECK_RET(LCD_LayerSetAddress(FB_LAYER - 1, (UINT32)fb_addr));
    LCD_CHECK_RET(LCD_LayerSetFormat(FB_LAYER - 1, LCD_LAYER_FORMAT_RGB565));
    LCD_CHECK_RET(LCD_LayerSetOffset(FB_LAYER - 1, 0, 0));
    LCD_CHECK_RET(LCD_LayerSetSize(FB_LAYER - 1, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT));
    LCD_CHECK_RET(LCD_LayerSetPitch(FB_LAYER - 1, ALIGN_TO(CFG_DISPLAY_WIDTH, MTK_FB_ALIGNMENT)*2));

#if 0
    if(0 == strncmp(MTK_LCM_PHYSICAL_ROTATION, "180", 3))
    {
		LCD_CHECK_RET(LCD_LayerSetRotation(FB_LAYER, LCD_LAYER_ROTATE_180));
		LCD_CHECK_RET(LCD_LayerSetRotation(FB_LAYER - 1, LCD_LAYER_ROTATE_180));
    }
#endif
}
Exemple #2
0
void mt_disp_init(void *lcdbase)
{
	unsigned int lcm_fake_width = 0;
	unsigned int lcm_fake_height = 0;
	UINT32 boot_mode_addr = 0;
	/// fb base pa and va
	fb_addr_pa_k = arm_mmu_va2pa(lcdbase);

	fb_addr_pa   = fb_addr_pa_k & 0xffffffffull;
	fb_addr      = lcdbase;

	dprintf(0,"fb_va: 0x%08x, fb_pa: 0x%08x, fb_pa_k: 0x%llx\n", fb_addr, fb_addr_pa, fb_addr_pa_k);

        fb_size = ALIGN_TO(CFG_DISPLAY_WIDTH, MTK_FB_ALIGNMENT) * ALIGN_TO(CFG_DISPLAY_HEIGHT, MTK_FB_ALIGNMENT) * CFG_DISPLAY_BPP / 8;
	// pa;
	boot_mode_addr = ((UINT32)fb_addr_pa + fb_size);
        logo_db_addr_pa = (void *)((UINT32)fb_addr_pa - 4 * 1024 * 1024);

	// va;
        logo_db_addr = (void *)((UINT32)fb_addr - 4 * 1024 * 1024);

	fb_offset_logo = 0;
  
        primary_display_init(NULL);
        memset((void*)lcdbase, 0x0, DISP_GetVRamSize());
    
        disp_input_config input;
        memset(&input, 0, sizeof(disp_input_config));
	input.layer 	= BOOT_MENU_LAYER;
	input.layer_en 	= 1;
	input.fmt 		= redoffset_32bit ? eBGRA8888 : eRGBA8888;
	input.addr		= boot_mode_addr;  
	input.src_x		= 0;
	input.src_y		= 0;
	input.src_w		= CFG_DISPLAY_WIDTH;
	input.src_h		= CFG_DISPLAY_HEIGHT;
	input.src_pitch = CFG_DISPLAY_WIDTH*4;
	input.dst_x		= 0;
	input.dst_y		= 0;
	input.dst_w		= CFG_DISPLAY_WIDTH;
	input.dst_h		= CFG_DISPLAY_HEIGHT;
	input.aen		= 1;
	input.alpha		= 0xff;
	
	primary_display_config_input(&input);

	memset(&input, 0, sizeof(disp_input_config));
	input.layer 	= FB_LAYER;
	input.layer_en 	= 1;
	input.fmt 		= redoffset_32bit ? eBGRA8888 : eRGBA8888;
	input.addr		= fb_addr_pa;
	input.src_x		= 0;
	input.src_y		= 0;
	input.src_w		= CFG_DISPLAY_WIDTH;
	input.src_h		= CFG_DISPLAY_HEIGHT;
	input.src_pitch = ALIGN_TO(CFG_DISPLAY_WIDTH, MTK_FB_ALIGNMENT)*4;
	input.dst_x		= 0;
	input.dst_y		= 0;
	input.dst_w		= CFG_DISPLAY_WIDTH;
	input.dst_h		= CFG_DISPLAY_HEIGHT;
	
	input.aen		= 1;
	input.alpha		= 0xff;
    	primary_display_config_input(&input);
	
 
	//_mtkfb_internal_test(fb_addr, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
    
#if 0
	mt_disp_parse_dfo_setting();	

	if((0 == mt_disp_get_dfo_setting("LCM_FAKE_WIDTH", &lcm_fake_width)) && (0 == mt_disp_get_dfo_setting("LCM_FAKE_HEIGHT", &lcm_fake_height)))
	{
		if(DISP_STATUS_OK != DISP_Change_LCM_Resolution(lcm_fake_width, lcm_fake_height))
		{
			dprintf(INFO,"[DISP_DFO]WARNING!!! Change LCM Resolution FAILED!!!\n");
		}
	}
#endif
    
}