Ejemplo n.º 1
0
static DISP_STATUS dpi_init(UINT32 fbVA, UINT32 fbPA, BOOL isLcmInited)
{
    if (!disp_drv_dpi_init_context()) 
        return DISP_STATUS_NOT_IMPLEMENTED;

#ifndef MT65XX_NEW_DISP
    init_intermediate_buffers(fbPA);
#else
    {
        struct disp_path_config_struct config = {0};
        
        config.srcModule = DISP_MODULE_OVL;

        config.bgROI.x = 0;
        config.bgROI.y = 0;
        config.bgROI.width = DISP_GetScreenWidth();
        config.bgROI.height = DISP_GetScreenHeight();
        config.bgColor = 0x0;  // background color

        config.pitch = DISP_GetScreenWidth()*2;
        config.srcROI.x = 0;config.srcROI.y = 0;
        config.srcROI.height= DISP_GetScreenHeight();config.srcROI.width= DISP_GetScreenWidth();
        config.ovl_config.source = OVL_LAYER_SOURCE_MEM; 
    
        // Disable FB layer (Layer3)
        {
            config.ovl_config.layer = FB_LAYER;
            config.ovl_config.layer_en = 0;
            disp_path_get_mutex();
            disp_path_config_layer(&config.ovl_config);
            disp_path_release_mutex();
            disp_path_wait_reg_update();
        }

        // Disable LK UI layer (Layer2)
        {
            config.ovl_config.layer = FB_LAYER-1;
            config.ovl_config.layer_en = 0;
            disp_path_get_mutex();
            disp_path_config_layer(&config.ovl_config);
            disp_path_release_mutex();
            disp_path_wait_reg_update();
        }

#if 1  // defined(MTK_M4U_SUPPORT)
        // Config FB_Layer port to be physical.
        {
            M4U_PORT_STRUCT portStruct;

            portStruct.ePortID = M4U_PORT_LCD_OVL;		   //hardware port ID, defined in M4U_PORT_ID_ENUM
            portStruct.Virtuality = 1;
            portStruct.Security = 0;
            portStruct.domain = 3;			  //domain : 0 1 2 3
            portStruct.Distance = 1;
            portStruct.Direction = 0;
            m4u_config_port(&portStruct);
        }
        // Reconfig FB_Layer and enable it.
#endif

        config.ovl_config.layer = FB_LAYER;
        config.ovl_config.layer_en = 1;
        config.ovl_config.fmt = OVL_INPUT_FORMAT_RGB565;
        config.ovl_config.addr = fbPA;
        config.ovl_config.source = OVL_LAYER_SOURCE_MEM;
        config.ovl_config.src_x = 0;
        config.ovl_config.src_y = 0;
        config.ovl_config.src_w = DISP_GetScreenWidth();
        config.ovl_config.src_h = DISP_GetScreenHeight();
        config.ovl_config.dst_x = 0;	   // ROI
        config.ovl_config.dst_y = 0;
        config.ovl_config.dst_w = DISP_GetScreenWidth();
        config.ovl_config.dst_h = DISP_GetScreenHeight();
        config.ovl_config.src_pitch = ALIGN_TO(DISP_GetScreenWidth(),32)*2; //pixel number
        config.ovl_config.keyEn = 0;
        config.ovl_config.key = 0xFF;	   // color key
        config.ovl_config.aen = 0;			  // alpha enable
        config.ovl_config.alpha = 0;
        LCD_LayerSetAddress(FB_LAYER, fbPA);
        LCD_LayerSetFormat(FB_LAYER, LCD_LAYER_FORMAT_RGB565);
        LCD_LayerSetOffset(FB_LAYER, 0, 0);
        LCD_LayerSetSize(FB_LAYER,DISP_GetScreenWidth(),DISP_GetScreenHeight());
        LCD_LayerSetPitch(FB_LAYER, ALIGN_TO(DISP_GetScreenWidth(),32) * 2);
        LCD_LayerEnable(FB_LAYER, TRUE);

        config.dstModule = DISP_MODULE_DPI0;// DISP_MODULE_WDMA1
        config.outFormat = RDMA_OUTPUT_FORMAT_ARGB;

        disp_path_get_mutex();

        disp_path_config(&config);
        disp_bls_config();

        disp_path_release_mutex();
    }
#endif
    init_mipi_pll();
    init_io_pad();
    init_io_driving_current();

    init_lcd();
    init_dpi(isLcmInited);

    if (NULL != lcm_drv->init && !isLcmInited) {
        lcm_drv->init();
    }

    return DISP_STATUS_OK;
}
Ejemplo n.º 2
0
static DISP_STATUS dsi_init(UINT32 fbVA, UINT32 fbPA, BOOL isLcmInited)
{
	if (!disp_drv_dsi_init_context()) 
		return DISP_STATUS_NOT_IMPLEMENTED;

	if(lcm_params->dsi.mode == CMD_MODE) {
#ifndef MT65XX_NEW_DISP
		init_lcd();
#endif
		init_dsi(isLcmInited);

		if (NULL != lcm_drv->init && !isLcmInited) 
		{
			lcm_drv->init();
			DSI_LP_Reset();
		}
#ifndef MT65XX_NEW_DISP
		DSI_clk_HS_mode(0);
#else
		DSI_clk_HS_mode(1);
#endif
		DSI_SetMode(lcm_params->dsi.mode);
#ifndef MT65XX_NEW_DISP
		DPI_PowerOn();
		DPI_PowerOff();

		init_lcd_te_control();
#endif
	}
	else {
#ifndef MT65XX_NEW_DISP
		init_intermediate_buffers(fbPA);

	    init_lcd();
		init_dpi(isLcmInited);
#endif
        if (!isLcmInited)
        {
        DSI_SetMode(0);
        mdelay(100);
        DSI_DisableClk();
        }
        else
        {
            is_video_mode_running = true;
        }
		init_dsi(isLcmInited);

		if (NULL != lcm_drv->init && !isLcmInited) {
			lcm_drv->init();
			DSI_LP_Reset();
		}

		DSI_SetMode(lcm_params->dsi.mode);

#ifndef BUILD_UBOOT	
#ifndef MT65XX_NEW_DISP
		if(lcm_params->dsi.lcm_ext_te_monitor)
		{
			is_video_mode_running = false;
			LCD_TE_SetMode(LCD_TE_MODE_VSYNC_ONLY);
			LCD_TE_SetEdgePolarity(LCM_POLARITY_RISING);
			LCD_TE_Enable(FALSE);
		}

		if(lcm_params->dsi.noncont_clock)
			DSI_set_noncont_clk(false, lcm_params->dsi.noncont_clock_period);

		if(lcm_params->dsi.lcm_int_te_monitor)
			DSI_set_int_TE(false, lcm_params->dsi.lcm_int_te_period);			
#endif
#endif			
	}
#ifdef MT65XX_NEW_DISP
		{
			struct disp_path_config_struct config = {0};
			config.srcModule = DISP_MODULE_OVL;
				config.bgROI.x = 0;
				config.bgROI.y = 0;
				config.bgROI.width = DISP_GetScreenWidth();
				config.bgROI.height = DISP_GetScreenHeight();
				config.bgColor = 0x0;	// background color
	
				config.pitch = DISP_GetScreenWidth()*2;
				config.srcROI.x = 0;config.srcROI.y = 0;
				config.srcROI.height= DISP_GetScreenHeight();config.srcROI.width= DISP_GetScreenWidth();
				config.ovl_config.source = OVL_LAYER_SOURCE_MEM; 
	
        if(lcm_params->dsi.mode != CMD_MODE)
        {
            config.ovl_config.layer = FB_LAYER;
            config.ovl_config.layer_en = 0;
            disp_path_get_mutex();
            disp_path_config_layer(&config.ovl_config);
            disp_path_release_mutex();
            disp_path_wait_reg_update();
        }
        // Config FB_Layer port to be physical.
        {
            M4U_PORT_STRUCT portStruct;
            portStruct.ePortID = M4U_PORT_OVL_CH3;		   //hardware port ID, defined in M4U_PORT_ID_ENUM
            portStruct.Virtuality = 1;
            portStruct.Security = 0;
            portStruct.domain = 3;			  //domain : 0 1 2 3
            portStruct.Distance = 1;
            portStruct.Direction = 0;
            m4u_config_port(&portStruct);
        }
        config.ovl_config.layer = FB_LAYER;
        config.ovl_config.layer_en = 1; 
        config.ovl_config.fmt = OVL_INPUT_FORMAT_RGB565;
        config.ovl_config.addr = fbPA;	
        config.ovl_config.source = OVL_LAYER_SOURCE_MEM; 
        config.ovl_config.src_x = 0;
        config.ovl_config.src_y = 0;
        config.ovl_config.dst_x = 0;	   // ROI
        config.ovl_config.dst_y = 0;
        config.ovl_config.dst_w = DISP_GetScreenWidth();
        config.ovl_config.dst_h = DISP_GetScreenHeight();
        config.ovl_config.src_pitch = ALIGN_TO(DISP_GetScreenWidth(),32)*2; //pixel number
        config.ovl_config.keyEn = 0;
        config.ovl_config.key = 0xFF;	   // color key
        config.ovl_config.aen = 0;			  // alpha enable
        config.ovl_config.alpha = 0;	

        LCD_LayerSetAddress(FB_LAYER, fbPA);
        LCD_LayerSetFormat(FB_LAYER, LCD_LAYER_FORMAT_RGB565);
        LCD_LayerSetOffset(FB_LAYER, 0, 0);
        LCD_LayerSetSize(FB_LAYER,DISP_GetScreenWidth(),DISP_GetScreenHeight());
        LCD_LayerSetPitch(FB_LAYER, ALIGN_TO(DISP_GetScreenWidth(),32) * 2);
        LCD_LayerEnable(FB_LAYER, TRUE);                    
        if(lcm_params->dsi.mode == CMD_MODE)
            config.dstModule = DISP_MODULE_DSI_CMD;// DISP_MODULE_WDMA1
        else
            config.dstModule = DISP_MODULE_DSI_VDO;// DISP_MODULE_WDMA1
        config.outFormat = RDMA_OUTPUT_FORMAT_ARGB; 
        if(lcm_params->dsi.mode != CMD_MODE)
            disp_path_get_mutex();

        disp_path_config(&config);

        if(lcm_params->dsi.mode != CMD_MODE)
            disp_path_release_mutex();

        // Disable LK UI layer (Layer2)
        if(lcm_params->dsi.mode != CMD_MODE)
        {
            config.ovl_config.layer = FB_LAYER-1;
            config.ovl_config.layer_en = 0;
            disp_path_get_mutex();
            disp_path_config_layer(&config.ovl_config);
            disp_path_release_mutex();
            disp_path_wait_reg_update();
        }

        // Config LK UI layer port to be physical.
        {
            M4U_PORT_STRUCT portStruct;
            portStruct.ePortID = M4U_PORT_OVL_CH2;		   //hardware port ID, defined in M4U_PORT_ID_ENUM
            portStruct.Virtuality = 1;
            portStruct.Security = 0;
            portStruct.domain = 3;			  //domain : 0 1 2 3
            portStruct.Distance = 1;
            portStruct.Direction = 0;
            m4u_config_port(&portStruct);
        }
		}
#endif

	return DISP_STATUS_OK;
}
Ejemplo n.º 3
0
static DISP_STATUS dpi_init(UINT32 fbVA, UINT32 fbPA, BOOL isLcmInited)
{
	if (!disp_drv_dpi_init_context())
		return DISP_STATUS_NOT_IMPLEMENTED;
#ifndef MT65XX_NEW_DISP
	init_intermediate_buffers(fbPA);
#else
	{
		struct disp_path_config_struct config = { 0 };

		if (DISP_IsDecoupleMode())
			config.srcModule = DISP_MODULE_RDMA;
		else
			config.srcModule = DISP_MODULE_OVL;

		config.bgROI.x = 0;
		config.bgROI.y = 0;
		config.bgROI.width = DISP_GetScreenWidth();
		config.bgROI.height = DISP_GetScreenHeight();
		config.bgColor = 0x0;	/* background color */

		config.srcROI.x = 0;
		config.srcROI.y = 0;
		config.srcROI.height = DISP_GetScreenHeight();
		config.srcROI.width = DISP_GetScreenWidth();
		config.ovl_config.source = OVL_LAYER_SOURCE_MEM;
#if 0
		/* Disable all layers. */
		/* First disable FB_Layer. */
		disp_path_get_mutex();
		config.ovl_config.layer = 0;
		config.ovl_config.layer_en = 0;
		disp_path_config_layer(&config.ovl_config);
		config.ovl_config.layer = 1;
		disp_path_config_layer(&config.ovl_config);
		config.ovl_config.layer = 2;
		disp_path_config_layer(&config.ovl_config);
		config.ovl_config.layer = 3;
		disp_path_config_layer(&config.ovl_config);
		disp_path_release_mutex();
		disp_path_wait_reg_update();
#endif
		/* Config FB_Layer port to be virtual. */
		{
			M4U_PORT_STRUCT portStruct;
			portStruct.ePortID = DISP_OVL_0;	/* hardware port ID, defined in M4U_PORT_ID_ENUM */
			portStruct.Virtuality = 1;
			portStruct.Security = 0;
			portStruct.domain = 3;	/* domain : 0 1 2 3 */
			portStruct.Distance = 1;
			portStruct.Direction = 0;
			m4u_config_port(&portStruct);
		}
		/* Reconfig FB_Layer and enable it. */

		config.ovl_config.layer = FB_LAYER;
		config.ovl_config.layer_en = 1;
		config.ovl_config.fmt = eRGB565;
		config.ovl_config.addr = fbPA;
		config.ovl_config.source = OVL_LAYER_SOURCE_MEM;
		config.ovl_config.src_x = 0;
		config.ovl_config.src_y = 0;
		config.ovl_config.dst_x = 0;	/* ROI */
		config.ovl_config.dst_y = 0;
		config.ovl_config.dst_w = DISP_GetScreenWidth();
		config.ovl_config.dst_h = DISP_GetScreenHeight();
		config.ovl_config.src_pitch = ALIGN_TO(DISP_GetScreenWidth(), 32) * 2;
		config.ovl_config.keyEn = 0;
		config.ovl_config.key = 0xFF;	/* color key */
		config.ovl_config.aen = 0;	/* alpha enable */
		config.ovl_config.alpha = 0;
		LCD_LayerSetAddress(FB_LAYER, fbPA);
		LCD_LayerSetFormat(FB_LAYER, LCD_LAYER_FORMAT_RGB565);
		LCD_LayerSetOffset(FB_LAYER, 0, 0);
		LCD_LayerSetSize(FB_LAYER, DISP_GetScreenWidth(), DISP_GetScreenHeight());
		LCD_LayerSetPitch(FB_LAYER, ALIGN_TO(DISP_GetScreenWidth(), 32) * 2);
		LCD_LayerEnable(FB_LAYER, TRUE);

		config.dstModule = DISP_MODULE_DPI0;	/* DISP_MODULE_WDMA1 */
		config.outFormat = RDMA_OUTPUT_FORMAT_ARGB;
		disp_path_get_mutex();
		disp_path_config(&config);
		disp_path_release_mutex();

	}
#endif
	init_mipi_pll();
	init_io_pad();
	init_io_driving_current();

	init_lcd();
	init_dpi(isLcmInited);

	if (NULL != lcm_drv->init && !isLcmInited)
		lcm_drv->init();

	DSI_PowerOn();
	DSI_PowerOff();
	UFOE_PowerOn();
	UFOE_PowerOff();
#ifdef SPM_SODI_ENABLED
	spm_sodi_lcm_video_mode(TRUE);
#endif
	return DISP_STATUS_OK;
}