msm: mdss: delay idle timeout until frame is ready

Current idle detection logic starts timer at beginning of the frame, but
if producer (GPU or others) takes some time to release fences we may be
signaling idle timeout before we even posted contents on the screen.
Revisit logic to wait until after fences have been signaled before
signaling idle timeout.

Change-Id: Id5ec0e334212484b257149727af0325b7acc3e86
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
This commit is contained in:
Adrian Salido-Moreno 2014-12-10 16:54:30 -08:00 committed by David Keitel
parent 02bf9488c8
commit 20719c0e3c

View file

@ -2507,9 +2507,11 @@ static int __mdss_fb_sync_buf_done_callback(struct notifier_block *p,
switch (event) { switch (event) {
case MDP_NOTIFY_FRAME_BEGIN: case MDP_NOTIFY_FRAME_BEGIN:
if (mfd->idle_time) if (mfd->idle_time && !mod_delayed_work(system_wq,
mod_delayed_work(system_wq, &mfd->idle_notify_work, &mfd->idle_notify_work,
msecs_to_jiffies(mfd->idle_time)); msecs_to_jiffies(WAIT_DISP_OP_TIMEOUT)))
pr_debug("fb%d: start idle delayed work\n",
mfd->index);
break; break;
case MDP_NOTIFY_FRAME_READY: case MDP_NOTIFY_FRAME_READY:
if (sync_pt_data->async_wait_fences && if (sync_pt_data->async_wait_fences &&
@ -2519,6 +2521,11 @@ static int __mdss_fb_sync_buf_done_callback(struct notifier_block *p,
__mdss_fb_wait_for_fence_sub(sync_pt_data, __mdss_fb_wait_for_fence_sub(sync_pt_data,
sync_pt_data->temp_fen, fence_cnt); sync_pt_data->temp_fen, fence_cnt);
} }
if (mfd->idle_time && !mod_delayed_work(system_wq,
&mfd->idle_notify_work,
msecs_to_jiffies(mfd->idle_time)))
pr_debug("fb%d: restarted idle work\n",
mfd->index);
break; break;
case MDP_NOTIFY_FRAME_FLUSHED: case MDP_NOTIFY_FRAME_FLUSHED:
pr_debug("%s: frame flushed\n", sync_pt_data->fence_name); pr_debug("%s: frame flushed\n", sync_pt_data->fence_name);