void LCD_vbi_event_proc(__u32 sel, __u32 tcon_index)
{    
        __u32 cur_line = 0, start_delay = 0;
        __u32 i = 0;

        //add by heyihang.Jan 28, 2013
        if(gdisp.screen[sel].vsync_event_en && gdisp.init_para.vsync_event)
        {
                gdisp.init_para.vsync_event(sel);
        }
        
	Video_Operation_In_Vblanking(sel, tcon_index);
        disp_capture_screen_proc(sel);
        cur_line = LCDC_get_cur_line(sel, tcon_index);
        start_delay = LCDC_get_start_delay(sel, tcon_index);
        if(cur_line > start_delay-3)
	{
	      //DE_INF("cur_line(%d) >= start_delay(%d)-3 in LCD_vbi_event_proc\n", cur_line, start_delay);
		return ;
	}

        if(gdisp.screen[sel].LCD_CPUIF_ISR)
        {
        	(*gdisp.screen[sel].LCD_CPUIF_ISR)();
        }

        if(gdisp.screen[sel].cache_flag == FALSE )//&& gdisp.screen[sel].cfg_cnt == 0)
        {
                for(i=0; i<2; i++)
                {
                        if((gdisp.scaler[i].status & SCALER_USED) && (gdisp.scaler[i].screen_index == sel))
                        {
                                DE_SCAL_Set_Reg_Rdy(i);
                                //DE_SCAL_Reset(i);
                                //DE_SCAL_Start(i);
                                gdisp.scaler[i].b_reg_change = FALSE;
                        }
                        if(gdisp.scaler[i].b_close == TRUE)
                        {
                                Scaler_close(i);
                                gdisp.scaler[i].b_close = FALSE;
                        }
                }
                DE_BE_Cfg_Ready(sel);
        	gdisp.screen[sel].have_cfg_reg = TRUE;
        }
#if 0
    cur_line = LCDC_get_cur_line(sel, tcon_index);
    
	if(cur_line > 5)
	{
    	DE_INF("%d\n", cur_line);
    }
#endif

    return ;
}
void LCD_vbi_event_proc(__u32 screen_id, __u32 tcon_index)
{
	__u32 cur_line = 0, start_delay = 0;
	__u32 i = 0;
	__u32 num_scalers;
#ifdef __LINUX_OSAL__
	unsigned long flags;
#endif
	num_scalers = bsp_disp_feat_get_num_scalers();

	disp_vint_checkin(screen_id);
	disp_lcd_set_fps(screen_id);

	Video_Operation_In_Vblanking(screen_id, tcon_index);
	disp_capture_screen_proc(screen_id);

	cur_line = TCON_get_cur_line(screen_id, tcon_index);
	start_delay = TCON_get_start_delay(screen_id, tcon_index);
	if(cur_line > start_delay-4) {
		//DE_INF("int:%d,%d\n", cur_line,start_delay);
		/* return while not  trigger mode  */
		if(gpanel_info[screen_id].lcd_fresh_mode == 0) {
			return ;
		}
	}

#ifdef __LINUX_OSAL__
	spin_lock_irqsave(&gdisp.screen[screen_id].flag_lock, flags);
#endif
	if(gdisp.screen[screen_id].cache_flag == FALSE && gdisp.screen[screen_id].cfg_cnt == 0) {
		gdisp.screen[screen_id].have_cfg_reg = TRUE;
#ifdef __LINUX_OSAL__
	spin_unlock_irqrestore(&gdisp.screen[screen_id].flag_lock, flags);
#endif
		DE_BE_Cfg_Ready(screen_id);
		IEP_CMU_Operation_In_Vblanking(screen_id);
		for(i=0; i<num_scalers; i++) {
			if((gdisp.scaler[i].status & SCALER_USED) && (gdisp.scaler[i].screen_index == screen_id))	{
				__u32 hid;

				if(gdisp.scaler[i].b_close == TRUE) {
					Scaler_close(i);
					gdisp.scaler[i].b_close = FALSE;
				}	else {
					hid = gdisp.scaler[i].layer_id;
					DE_SCAL_Set_Reg_Rdy(i);
					//DE_SCAL_Reset(i);
					//DE_SCAL_Start(i);
					disp_deu_set_frame_info(screen_id, IDTOHAND(hid));
					disp_deu_output_select(screen_id, IDTOHAND(hid), screen_id);
					IEP_Deu_Operation_In_Vblanking(i);
				}
				gdisp.scaler[i].b_reg_change = FALSE;
			}
		}

		if(DISP_OUTPUT_TYPE_LCD == bsp_disp_get_output_type(screen_id)) {
			IEP_Drc_Operation_In_Vblanking(screen_id);
		}

		if(gdisp.init_para.take_effect) {
			gdisp.init_para.take_effect(screen_id);
		}
	} else {
#ifdef __LINUX_OSAL__
	spin_unlock_irqrestore(&gdisp.screen[screen_id].flag_lock, flags);
#endif
	}

#if 0
	cur_line = LCDC_get_cur_line(screen_id, tcon_index);

	if(cur_line > 5) {
		DE_INF("%d\n", cur_line);
	}
#endif

	return ;
}