static int mdp3_wait4vsync(struct mdp3_dma *dma, bool killable, unsigned long timeout) { int rc; int timeouts = 0; static int timeout_occurred; int prev_vsync_cnt = dma->vsync_cnt; unsigned long tout = timeout ? timeout : KOFF_TIMEOUT; do { if (killable) { rc = wait_for_completion_killable_timeout( &dma->vsync_comp, tout); } else { rc = wait_for_completion_timeout( &dma->vsync_comp, tout); } if (rc == -ERESTARTSYS) return rc; if (rc == 0) { pr_err("%s: TIMEOUT (vsync_cnt: prev: %u cur: %u)\n", __func__, prev_vsync_cnt, dma->vsync_cnt); timeout_occurred = 1; if (timeouts == 0 && dma->vsync_cnt > 0) mdss_timeout_dump(__func__); timeouts++; } else { if (timeout_occurred) pr_info("%s: recovered from previous timeout\n", __func__); timeout_occurred = 0; break; } } while (timeout == 0); if (timeout == 0 && timeouts) pr_err("%s: wait of %u ms timed out %d times!\n", __func__, jiffies_to_msecs(tout), timeouts); return rc; }
void mdss_timeout_dropbox_trigger_callback(void *data) { mdss_timeout_dump((struct msm_fb_data_type *)data, __func__); }