From c855791a1bc86dc53ef87f57dc931d17d76531b4 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Tue, 21 May 2013 11:34:23 -0400 Subject: msm: mdss: Do not time out for vsync reads The userspace does a blocking read on the vsync node. However, when the screen is idle the read returns after timeout waking up the userspace thread. Remove the timeout so that the read blocks until the vsync is updated. Change-Id: Ieaa1c180d473256da14302875dfc0558d23123aa Signed-off-by: Naseer Ahmed --- drivers/video/fbdev/msm/mdp3_ctrl.c | 10 +++------- drivers/video/fbdev/msm/mdss_mdp_overlay.c | 12 +++--------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/video/fbdev/msm/mdp3_ctrl.c b/drivers/video/fbdev/msm/mdp3_ctrl.c index b5134a7bcdf7..037ab511b131 100644 --- a/drivers/video/fbdev/msm/mdp3_ctrl.c +++ b/drivers/video/fbdev/msm/mdp3_ctrl.c @@ -192,13 +192,9 @@ static ssize_t mdp3_vsync_show_event(struct device *dev, mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1; - rc = wait_for_completion_interruptible_timeout( - &mdp3_session->vsync_comp, - msecs_to_jiffies(VSYNC_PERIOD * 5)); - if (rc <= 0) { - pr_warn("vsync wait on fb%d interrupted (%d)\n", - mfd->index, rc); - } + rc = wait_for_completion_interruptible(&mdp3_session->vsync_comp); + if (rc < 0) + return rc; spin_lock_irqsave(&mdp3_session->vsync_lock, flag); vsync_ticks = ktime_to_ns(mdp3_session->vsync_time); diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index c96464a2dcaf..4a03e13d3da8 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -1286,20 +1286,14 @@ static ssize_t mdss_mdp_vsync_show_event(struct device *dev, struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); unsigned long flags; u64 vsync_ticks; - unsigned long timeout; int ret; if (!mdp5_data->ctl || !mdp5_data->ctl->power_on) return 0; - timeout = msecs_to_jiffies(VSYNC_PERIOD * 5); - ret = wait_for_completion_interruptible_timeout(&mdp5_data->vsync_comp, - timeout); - if (ret <= 0) { - pr_debug("Sending current time as vsync timestamp for fb%d\n", - mfd->index); - mdp5_data->vsync_time = ktime_get(); - } + ret = wait_for_completion_interruptible(&mdp5_data->vsync_comp); + if (ret < 0) + return ret; spin_lock_irqsave(&mdp5_data->vsync_lock, flags); vsync_ticks = ktime_to_ns(mdp5_data->vsync_time); -- cgit v1.2.3