From 3d2a71a568ff1bf5efbde00d69e42395e9b2d3d6 Mon Sep 17 00:00:00 2001 From: Kalyan Thota Date: Tue, 29 Dec 2015 15:34:32 +0530 Subject: [PATCH] msm: mdss: turn on the mdss clocks when enabling vsync Switch on the mdss clocks while enabling vsync irq. Since mdss clocks are refcounted and irq is asynchronus there can be case as clocks are off and irq is triggered. This change will add a refcount while enabling irq so that clocks are on when irq is triggered. Change-Id: I90728f6d94b9d846b2c805a68ee49a6ef2a8ffc3 Signed-off-by: Kalyan Thota --- drivers/video/fbdev/msm/mdss_mdp_intf_video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c index 024d0a94eeed..1498081532a6 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c @@ -396,8 +396,10 @@ static int mdss_mdp_video_add_vsync_handler(struct mdss_mdp_ctl *ctl, irq_en = true; } spin_unlock_irqrestore(&ctx->vsync_lock, flags); - if (irq_en) + if (irq_en) { + mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); video_vsync_irq_enable(ctl, false); + } exit: return ret; } @@ -424,8 +426,10 @@ static int mdss_mdp_video_remove_vsync_handler(struct mdss_mdp_ctl *ctl, irq_dis = true; } spin_unlock_irqrestore(&ctx->vsync_lock, flags); - if (irq_dis) + if (irq_dis) { video_vsync_irq_disable(ctl); + mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); + } return 0; }