예제 #1
0
static void init_lcd(void)
{
    UINT32 i;

    LCD_CHECK_RET(LCD_LayerEnable(LCD_LAYER_ALL, FALSE));
    LCD_CHECK_RET(LCD_LayerSetTriggerMode(LCD_LAYER_ALL, LCD_SW_TRIGGER));
    LCD_CHECK_RET(LCD_EnableHwTrigger(FALSE));

    LCD_CHECK_RET(LCD_SetBackgroundColor(0));
    LCD_CHECK_RET(LCD_SetRoiWindow(0, 0, DISP_GetScreenWidth(), DISP_GetScreenHeight()));

    LCD_CHECK_RET(LCD_FBSetFormat(lcdTmpBufFormat));
    LCD_CHECK_RET(LCD_FBSetPitch(s_tmpBuffers[0].pitchInBytes));
    LCD_CHECK_RET(LCD_FBSetStartCoord(0, 0));

    for (i = 0; i < lcm_params->dpi.intermediat_buffer_num; ++ i)
    {
        LCD_CHECK_RET(LCD_FBSetAddress(LCD_FB_0 + i, s_tmpBuffers[i].pa));
        LCD_CHECK_RET(LCD_FBEnable(LCD_FB_0 + i, TRUE));
    }
    
    LCD_CHECK_RET(LCD_SetOutputMode(LCD_OUTPUT_TO_MEM));
    /**
       "LCD Delay Enable" function should be used when there is only
       single buffer between LCD and DPI.
       Double buffer even triple buffer need not enable it.
    */
    LCD_CHECK_RET(LCD_WaitDPIIndication(TRUE));
}
static void init_lcd(void)
{
    UINT32 i;		
    
    // Config LCD Controller
    LCD_CHECK_RET(LCD_LayerEnable(LCD_LAYER_ALL, FALSE));
    LCD_CHECK_RET(LCD_LayerSetTriggerMode(LCD_LAYER_ALL, LCD_SW_TRIGGER));
    LCD_CHECK_RET(LCD_EnableHwTrigger(FALSE));
    
    LCD_CHECK_RET(LCD_SetBackgroundColor(0));
    
    if(lcm_params->dsi.mode == CMD_MODE)
        LCD_CHECK_RET(LCD_SetRoiWindow(0, 0, lcm_params->width, lcm_params->height));
    else
        LCD_CHECK_RET(LCD_SetRoiWindow(0, 0, DISP_GetScreenWidth(), DISP_GetScreenHeight()));
    
    if(lcm_params->dsi.mode == CMD_MODE) {
        LCD_CHECK_RET(LCD_ConfigDSIIfFormat(lcm_params->dsi.data_format.color_order,
                                                                            lcm_params->dsi.data_format.trans_seq,
                                                                            lcm_params->dsi.data_format.padding,
                                                                            lcm_params->dsi.data_format.format,
                                                                            lcm_params->dsi.packet_size,
                                                                            TRUE));
        
        LCD_CHECK_RET(LCD_SetOutputMode(LCD_OUTPUT_TO_LCM));
        LCD_CHECK_RET(LCD_WaitDPIIndication(FALSE));
        LCD_CHECK_RET(LCD_FBEnable(LCD_FB_0, FALSE));
        LCD_CHECK_RET(LCD_FBEnable(LCD_FB_1, FALSE));
        LCD_CHECK_RET(LCD_FBEnable(LCD_FB_2, FALSE));
    } 
    else {
        LCD_CHECK_RET(LCD_FBSetFormat(get_lcd_tmp_buffer_format()));
        LCD_CHECK_RET(LCD_FBSetPitch(s_tmpBuffers[0].pitchInBytes));
        LCD_CHECK_RET(LCD_FBSetStartCoord(0, 0));
        
        for (i = 0; i < lcm_params->dsi.intermediat_buffer_num; ++ i)
        {
            LCD_CHECK_RET(LCD_FBSetAddress(LCD_FB_0 + i, s_tmpBuffers[i].pa));
            LCD_CHECK_RET(LCD_FBEnable(LCD_FB_0 + i, TRUE));
        }
        
        LCD_CHECK_RET(LCD_SetOutputMode(LCD_OUTPUT_TO_MEM));
        LCD_CHECK_RET(LCD_WaitDPIIndication(TRUE));
    }
}
예제 #3
0
void TVDVT_init_lcd(void)
{

    UINT32 i;


    LCD_CHECK_RET(LCD_LayerSetAddress(LCD_LAYER_0, src_buf_pa));
    LCD_CHECK_RET(LCD_LayerSetFormat(LCD_LAYER_0, LCD_LAYER_FORMAT_RGB888));
    LCD_CHECK_RET(LCD_LayerSetOffset(LCD_LAYER_0, 0, 0));
    LCD_CHECK_RET(LCD_LayerSetSize(LCD_LAYER_0,  SCREEN_WIDTH,SCREEN_HEIGHT));


    LCD_CHECK_RET(LCD_LayerSetPitch(LCD_LAYER_0, SCREEN_WIDTH * 3));


    LCD_CHECK_RET(LCD_LayerEnable(LCD_LAYER_0, FALSE));
    //LCD_CHECK_RET(LCD_LayerEnable(LCD_LAYER_ALL, FALSE));

    //LCD_CHECK_RET(LCD_LayerSetTriggerMode(LCD_LAYER_ALL, LCD_SW_TRIGGER));
    LCD_CHECK_RET(LCD_LayerSetTriggerMode(LCD_LAYER_0, LCD_SW_TRIGGER));


    LCD_CHECK_RET(LCD_EnableHwTrigger(FALSE));

    LCD_CHECK_RET(LCD_SetBackgroundColor(0));
    LCD_CHECK_RET(LCD_SetRoiWindow(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));

    LCD_CHECK_RET(LCD_FBSetFormat(LCD_FB_FORMAT_RGB888));
    LCD_CHECK_RET(LCD_FBSetPitch(SCREEN_WIDTH * 3 ));
    LCD_CHECK_RET(LCD_FBSetStartCoord(0, 0));
/*
    for (i = 0; i < lcm_params.dpi.intermediat_buffer_num; ++ i)
    {
        LCD_CHECK_RET(LCD_FBSetAddress(LCD_FB_0 + i, s_tmpBuffers[i].pa));
        LCD_CHECK_RET(LCD_FBEnable(LCD_FB_0 + i, TRUE));
    }
*/

    LCD_CHECK_RET(LCD_FBSetAddress(LCD_FB_0, dst_buf_pa)); //buffer address.
    LCD_CHECK_RET(LCD_FBEnable(LCD_FB_0, TRUE));

    //LCD_CHECK_RET(LCD_SetOutputMode(LCD_OUTPUT_TO_MEM));
    LCD_CHECK_RET(LCD_SetOutputMode(LCD_OUTPUT_TO_TVROT));


    LCD_CHECK_RET(LCD_LayerEnable(LCD_LAYER_0, TRUE));


}
예제 #4
0
static void init_lcd(void)
{
	/* Config LCD Controller */

	LCD_CHECK_RET(LCD_LayerEnable(LCD_LAYER_ALL, FALSE));
	LCD_CHECK_RET(LCD_LayerSetTriggerMode(LCD_LAYER_ALL, LCD_SW_TRIGGER));
	LCD_CHECK_RET(LCD_EnableHwTrigger(FALSE));

	LCD_CHECK_RET(LCD_SetBackgroundColor(0));
	LCD_CHECK_RET(LCD_SetRoiWindow(0, 0, lcm_params->width, lcm_params->height));

	LCD_CHECK_RET(LCD_SetOutputMode(LCD_OUTPUT_TO_LCM));
	LCD_CHECK_RET(LCD_WaitDPIIndication(FALSE));
	LCD_CHECK_RET(LCD_FBEnable(LCD_FB_0, FALSE));
	LCD_CHECK_RET(LCD_FBEnable(LCD_FB_1, FALSE));
	LCD_CHECK_RET(LCD_FBEnable(LCD_FB_2, FALSE));
}
static void init_lcd(BOOL isLcdPoweredOn)
{
    // Config LCD Controller
    LCD_CHECK_RET(LCD_Init(isLcdPoweredOn));

    LCD_CHECK_RET(LCD_LayerEnable(LCD_LAYER_ALL, FALSE));
    LCD_CHECK_RET(LCD_LayerSetTriggerMode(LCD_LAYER_ALL, LCD_SW_TRIGGER));
    LCD_CHECK_RET(LCD_EnableHwTrigger(FALSE));

    LCD_CHECK_RET(LCD_SetBackgroundColor(0));
    LCD_CHECK_RET(LCD_SetRoiWindow(0, 0, DISP_GetScreenWidth(), DISP_GetScreenHeight()));

    LCD_CHECK_RET(LCD_SetOutputMode(LCD_OUTPUT_TO_LCM));
    LCD_CHECK_RET(LCD_WaitDPIIndication(FALSE));
    LCD_CHECK_RET(LCD_FBEnable(LCD_FB_0, FALSE));
    LCD_CHECK_RET(LCD_FBEnable(LCD_FB_1, FALSE));
    LCD_CHECK_RET(LCD_FBEnable(LCD_FB_2, FALSE));
}
예제 #6
0
/* Will only be used in ioctl(MTK_HDMI_AUDIO_VIDEO_ENABLE) */
static HDMI_STATUS hdmi_drv_init(void)
{
    int lcm_width, lcm_height;
    int tmpBufferSize;
		M4U_PORT_STRUCT portStruct;

    HDMI_FUNC();

    RETIF(p->output_mode == HDMI_OUTPUT_MODE_DPI_BYPASS, 0);

    p->hdmi_width = 1280;
    p->hdmi_height = 720;

    lcm_width = DISP_GetScreenWidth();
    lcm_height = DISP_GetScreenHeight();

    //printk("[hdmi]%s, hdmi_width=%d, hdmi_height=%d\n", __func__, p->hdmi_width, p->hdmi_height);
    HDMI_LOG("lcm_width=%d, lcm_height=%d\n", lcm_width, lcm_height);

    tmpBufferSize = lcm_width * lcm_height *4 * 4;

    temp_va = (unsigned int) vmalloc(tmpBufferSize);
    if (((void*) temp_va) == NULL)
    {
        HDMI_LOG("vmalloc %dbytes fail\n", tmpBufferSize);
        return -1;
    }

    // WDMA1
    if (m4u_alloc_mva(M4U_CLNTMOD_WDMA, 
						temp_va, 
						tmpBufferSize,
						0,
						0,
						&temp_mva_w))
    {
        HDMI_LOG("m4u_alloc_mva for temp_mva_w fail\n");
        return -1;
    }
		m4u_dma_cache_maint(M4U_CLNTMOD_WDMA, 
						temp_va, 
						tmpBufferSize,
						DMA_BIDIRECTIONAL);

	portStruct.ePortID = M4U_PORT_WDMA1;			 //hardware port ID, defined in M4U_PORT_ID_ENUM
	portStruct.Virtuality = 1;							 
	portStruct.Security = 0;
	portStruct.domain = 0;						//domain : 0 1 2 3
	portStruct.Distance = 1;
	portStruct.Direction = 0; 	
	m4u_config_port(&portStruct);

    HDMI_LOG("temp_va=0x%08x, temp_mva_w=0x%08x\n", temp_va, temp_mva_w);

    p->lcm_width = lcm_width;
    p->lcm_height = lcm_height;
    p->output_video_resolution = hdmi_params->init_config.vformat;
    p->output_audio_format = hdmi_params->init_config.aformat;

//#ifdef NEW_HDMI_ARCH
//    hdmi_display_path_overlay_config(true);
//#endif
	DISP_Config_Overlay_to_Memory(temp_mva_w, 1);

    //hdmi_dpi_config_clock(); // configure dpi clock

    //hdmi_dpi_power_switch(false);   // but dpi power is still off
    //hdmi_drv->suspend();

#if 0
    LCD_WaitForNotBusy();
    LCD_SetOutputMode(3); // LCD write to memory and LCM
#endif

    return HDMI_STATUS_OK;
}