Beispiel #1
0
__s32 bsp_disp_hdmi_open(__u32 screen_id)
{
	if(disp_hdmi_get_support(screen_id) && (gdisp.screen[screen_id].hdmi_used)
	    && (!(gdisp.screen[screen_id].status & HDMI_ON))) {
		__disp_tv_mode_t     tv_mod;

		tv_mod = gdisp.screen[screen_id].hdmi_mode;

		hdmi_clk_on();
		lcdc_clk_on(screen_id, 1, 0);
		lcdc_clk_on(screen_id, 1, 1);
		drc_clk_open(screen_id,0);
		drc_clk_open(screen_id,1);
		tcon_init(screen_id);
		image_clk_on(screen_id, 1);
		/* set image normal channel start bit , because every de_clk_off( )will reset this bit */
		Image_open(screen_id);
		disp_clk_cfg(screen_id,DISP_OUTPUT_TYPE_HDMI, tv_mod);

		//bsp_disp_set_output_csc(screen_id, DISP_OUTPUT_TYPE_HDMI, gdisp.screen[screen_id].iep_status&DRC_USED);
		if(gdisp.init_para.hdmi_cts_compatibility == 0)	{
			DE_INF("bsp_disp_hdmi_open: disable dvi mode\n");
			bsp_disp_hdmi_dvi_enable(screen_id, 0);
		}	else if(gdisp.init_para.hdmi_cts_compatibility == 1) {
			DE_INF("bsp_disp_hdmi_open: enable dvi mode\n");
			bsp_disp_hdmi_dvi_enable(screen_id, 1);
		}	else {
			bsp_disp_hdmi_dvi_enable(screen_id, bsp_disp_hdmi_dvi_support(screen_id));
		}

		if(BSP_dsip_hdmi_get_input_csc(screen_id) == 0) {
			__inf("bsp_disp_hdmi_open:   hdmi output rgb\n");
			gdisp.screen[screen_id].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_RGB;
			bsp_disp_set_output_csc(screen_id, gdisp.screen[screen_id].output_csc_type, bsp_disp_drc_get_input_csc(screen_id));
		} else {
			__inf("bsp_disp_hdmi_open:   hdmi output yuv\n");
			gdisp.screen[screen_id].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_YUV;//default  yuv
			bsp_disp_set_output_csc(screen_id, gdisp.screen[screen_id].output_csc_type, bsp_disp_drc_get_input_csc(screen_id));
		}
		DE_BE_set_display_size(screen_id, tv_mode_to_width(tv_mod), tv_mode_to_height(tv_mod));
		DE_BE_Output_Select(screen_id, screen_id);
		bsp_disp_hdmi_set_src(screen_id, DISP_LCDC_SRC_DE_CH1);

		tcon1_set_hdmi_mode(screen_id,tv_mod);
		tcon1_open(screen_id);
		if(gdisp.init_para.hdmi_open)	{
			gdisp.init_para.hdmi_open();
		}	else {
			DE_WRN("Hdmi_open is NULL\n");
			return -1;
		}

		Disp_Switch_Dram_Mode(DISP_OUTPUT_TYPE_HDMI, tv_mod);

		gdisp.screen[screen_id].b_out_interlace = disp_get_screen_scan_mode(tv_mod);
		gdisp.screen[screen_id].status |= HDMI_ON;
		gdisp.screen[screen_id].lcdc_status |= LCDC_TCON1_USED;
		gdisp.screen[screen_id].output_type = DISP_OUTPUT_TYPE_HDMI;

		if(bsp_disp_cmu_get_enable(screen_id) ==1) {
			IEP_CMU_Set_Imgsize(screen_id, bsp_disp_get_screen_width(screen_id), bsp_disp_get_screen_height(screen_id));
		}

		Disp_set_out_interlace(screen_id);
#ifdef __LINUX_OSAL__
		Display_set_fb_timming(screen_id);
#endif
		return DIS_SUCCESS;
	}

	return DIS_NOT_SUPPORT;
}
Beispiel #2
0
__s32 BSP_disp_hdmi_open(__u32 sel)
{
    if(!(gdisp.screen[sel].status & HDMI_ON))
    {
        __disp_tv_mode_t     tv_mod;
        tv_mod = gdisp.screen[sel].hdmi_mode;
        BSP_disp_hdmi_get_hdcp_enable();
        hdmi_clk_on();
        if(gdisp.screen[sel].hdmi_hdcp_en)
            hdcp_clk_init(tv_mod);
        lcdc_clk_on(sel, 1, 0);
        lcdc_clk_on(sel, 1, 1);
        Disp_lcdc_reg_isr(sel);
        LCDC_init(sel);
        image_clk_on(sel, 0);
        image_clk_on(sel, 1);
        Image_open(sel);//set image normal channel start bit , because every de_clk_off( )will reset this bit
        DE_BE_EnableINT(sel, DE_IMG_REG_LOAD_FINISH);
        disp_clk_cfg(sel,DISP_OUTPUT_TYPE_HDMI, tv_mod);

        if(gdisp.init_para.hdmi_cts_compatibility == 0)
        {
            DE_INF("BSP_disp_hdmi_open: disable dvi mode\n");
            BSP_disp_hdmi_dvi_enable(sel, 0);
        }
        else if(gdisp.init_para.hdmi_cts_compatibility == 1)
        {
            DE_INF("BSP_disp_hdmi_open: enable dvi mode\n");
            BSP_disp_hdmi_dvi_enable(sel, 1);
        }
        else
        {
            BSP_disp_hdmi_dvi_enable(sel, BSP_disp_hdmi_dvi_support(sel));
        }

        if(BSP_dsip_hdmi_get_input_csc(sel) == 0)
        {
            __inf("BSP_disp_hdmi_open:   hdmi output rgb\n");
            gdisp.screen[sel].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_RGB;
            BSP_disp_set_output_csc(sel, gdisp.screen[sel].output_csc_type);
        }else
        {
            __inf("BSP_disp_hdmi_open:   hdmi output yuv\n");
            gdisp.screen[sel].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_YUV;//default  yuv
            BSP_disp_set_output_csc(sel, gdisp.screen[sel].output_csc_type);
        }
        DE_BE_set_display_size(sel, tv_mode_to_width(tv_mod), tv_mode_to_height(tv_mod));
        DE_BE_Output_Select(sel, sel);

        tcon1_set_hdmi_mode(sel,tv_mod);
        tcon1_open(sel);
        if(gdisp.init_para.hdmi_open)
        {
            gdisp.init_para.hdmi_open();
        }
        else
        {
            DE_WRN("hdmi_open is NULL\n");
            return -1;
        }

        Disp_Switch_Dram_Mode(DISP_OUTPUT_TYPE_HDMI, tv_mod);

        gdisp.screen[sel].b_out_interlace = Disp_get_screen_scan_mode(tv_mod);
        gdisp.screen[sel].status |= HDMI_ON;
        gdisp.screen[sel].lcdc_status |= LCDC_TCON1_USED;
        gdisp.screen[sel].output_type = DISP_OUTPUT_TYPE_HDMI;

        Disp_set_out_interlace(sel);
#ifdef __LINUX_OSAL__
        Display_set_fb_timming(sel);
#endif
    }
    
    return DIS_SUCCESS;
}