Esempio n. 1
0
static irqreturn_t _DPI_InterruptHandler(int irq, void *dev_id)
{   
    static int counter = 0;
    DPI_REG_INTERRUPT status = DPI_REG->INT_STATUS;
//    if (status.FIFO_EMPTY) ++ counter;

    if(status.VSYNC)
    {
        if(dpiIntCallback)
           dpiIntCallback(DISP_DPI_VSYNC_INT);
#ifndef BUILD_UBOOT
		if(wait_dpi_vsync){
			if(-1 != hrtimer_try_to_cancel(&hrtimer_vsync_dpi)){
				dpi_vsync = true;
//			hrtimer_try_to_cancel(&hrtimer_vsync_dpi);
				wake_up_interruptible(&_vsync_wait_queue_dpi);
			}
		}
#endif
    }

    if (status.VSYNC && counter) {
        DISP_LOG_PRINT(ANDROID_LOG_ERROR, "DPI", "[Error] DPI FIFO is empty, "
               "received %d times interrupt !!!\n", counter);
        counter = 0;
    }

    _DPI_LogRefreshRate(status);
	OUTREG32(&DPI_REG->INT_STATUS, 0);
    return IRQ_HANDLED;
}
Esempio n. 2
0
static irqreturn_t _DPI_InterruptHandler(int irq, void *dev_id)
{   
    static int counter = 0;
    DPI_REG_INTERRUPT status = DPI_REG->INT_STATUS;
//    if (status.FIFO_EMPTY) ++ counter;

    if(status.VSYNC)
    {
        if(dpiIntCallback)
           dpiIntCallback(DISP_DPI_VSYNC_INT);
    }

    if (status.VSYNC && counter) {
        DISP_LOG_PRINT(ANDROID_LOG_ERROR, "DPI", "[Error] DPI FIFO is empty, "
               "received %d times interrupt !!!\n", counter);
        counter = 0;
    }

	 if (status.FIFO_EMPTY)
	 {	 		
		DSI_handle_esd_recovery();
	 }

    _DPI_LogRefreshRate(status);
	OUTREG32(&DPI_REG->INT_STATUS, 0);
    return IRQ_HANDLED;
}
Esempio n. 3
0
static __tcmfunc irqreturn_t _DPI_InterruptHandler(int irq, void *dev_id)
{   
    static int counter = 0;
    DPI_REG_INTERRUPT status = DPI_REG->INT_STATUS;
    if (status.FIFO_EMPTY) ++ counter;

    if (status.VSYNC && counter) {
        printk("[Error] DPI FIFO is empty, "
               "received %d times interrupt !!!\n", counter);
        counter = 0;
    }

    _DPI_LogRefreshRate(status);

    return IRQ_HANDLED;
}
static irqreturn_t _DPI_InterruptHandler(int irq, void *dev_id)
{   
    static int counter = 0;
    DPI_REG_INTERRUPT status = DPI_REG->INT_STATUS;
//    if (status.FIFO_EMPTY) ++ counter;

    if(status.VSYNC)
    {
        if(dpiIntCallback)
           dpiIntCallback(DISP_DPI_VSYNC_INT);
#ifndef BUILD_UBOOT
		if(atomic_read(&wait_dpi_vsync)){
			if(-1 != hrtimer_try_to_cancel(&hrtimer_vsync_dpi)){
				atomic_set(&wait_dpi_vsync, 0);
				atomic_set(&dpi_vsync, 1);
				wake_up_interruptible(&_vsync_wait_queue_dpi);
				hrtimer_start(&hrtimer_vsync_dpi, ktime_set(0, VSYNC_US_TO_NS(vsync_timer_dpi)), HRTIMER_MODE_REL);
			}
		}
#endif
    }

    if (status.VSYNC && counter) {
        DISP_LOG_PRINT(ANDROID_LOG_ERROR, "DPI", "[Error] DPI FIFO is empty, "
               "received %d times interrupt !!!\n", counter);
        counter = 0;
    }

	 if (status.FIFO_EMPTY)
	 {	 		
		DSI_handle_esd_recovery();
	 }

    _DPI_LogRefreshRate(status);
	OUTREG32(&DPI_REG->INT_STATUS, 0);
    return IRQ_HANDLED;
}
Esempio n. 5
0
static irqreturn_t _DPI_InterruptHandler(int irq, void *dev_id)
{   
    static int counter = 0;
    DPI_REG_INTERRUPT status = DPI_REG->INT_STATUS;
//    if (status.FIFO_EMPTY) ++ counter;

    if(status.VSYNC)
    {
        if(dpiIntCallback)
           dpiIntCallback(DISP_DPI_VSYNC_INT);
#ifndef BUILD_UBOOT
		if(atomic_read(&wait_dpi_vsync)){
			if(-1 != hrtimer_try_to_cancel(&hrtimer_vsync_dpi)){
				atomic_set(&wait_dpi_vsync, 0);
				atomic_set(&dpi_vsync, 1);
				wake_up_interruptible(&_vsync_wait_queue_dpi);
				hrtimer_start(&hrtimer_vsync_dpi, ktime_set(0, VSYNC_US_TO_NS(vsync_timer_dpi)), HRTIMER_MODE_REL);
			}
		}
#endif
    }

    if (status.VSYNC && counter) {
        DISP_LOG_PRINT(ANDROID_LOG_ERROR, "DPI", "[Error] DPI FIFO is empty, "
               "received %d times interrupt !!!\n", counter);
        counter = 0;
    }

	 if (status.FIFO_EMPTY)
	 {	 		
	 	int need_reset = 0;
	 	unsigned long long temp = sched_clock();

		unsigned int debug_while_loop_cnt = 0;
		volatile unsigned int dsi_state = INREG32(DSI_BASE+0x154);
		if((dsi_state & 0x1ff) == 0x80)
		{
			auto_sync_reset_count++;
			if(auto_sync_reset_count == 10)
			{
				auto_sync_reset_count = 0;
				need_reset = 2;
			}
		}
		else
		{
			auto_sync_reset_count = 0;
		}
		
		//printk("gmce,0x%08x, %d\n",(INREG32(DSI_BASE+0x154))&0x1ff, (unsigned int)(temp - last_fifo_empty_stamp));
		if(_fifo_empty_monitor_insert((unsigned int)(temp - last_fifo_empty_stamp)))
		{
			need_reset = 1;
		}
		
		last_fifo_empty_stamp = temp;
		if(need_reset)
		{
			unsigned int mode, suspend;

			mode = DSI_GetMode();
			suspend = DISP_GetSuspendMode();
			if ((mode != CMD_MODE) && !suspend)
			{      	
			DPI_DisableClk();
			#if 0
			while(1)
			{
				debug_while_loop_cnt++;
				dsi_state = INREG32(DSI_BASE+0x154);
				if((dsi_state &0x1ff) == 0x100) break;
				if(debug_while_loop_cnt > 0x1000000) 
				{
					printk("FATAL Error!! dsi in vact when dpi fifo empty, and can't into vfp until 0x100000 loops!!\n");
				}
	 }
			#endif

			DSI_clk_HS_mode(0);
			DSI_SetMode(CMD_MODE);
			DSI_Reset();
			DSI_SetMode(SYNC_PULSE_VDO_MODE);
			DSI_clk_HS_mode(1);
			DPI_EnableClk();
			DSI_EnableClk();
			}
			printk("[DSI/DPI]reset[%d] mode[%d], suspend[%d]\n", need_reset, mode, suspend);
			need_reset = 0;
		}		
	}
    _DPI_LogRefreshRate(status);
	OUTREG32(&DPI_REG->INT_STATUS, 0);
    return IRQ_HANDLED;
}