From 7c3bc73fe6fa19c338a19f10aa925eb54ccdce8c Mon Sep 17 00:00:00 2001 From: Ajay Singh Parmar Date: Thu, 19 Jun 2014 14:53:20 -0700 Subject: [PATCH] msm: mdss: decouple clk ctrl and bw ctrl Move bandwidth control to panel on and off functions to speed up the clock control. CRs-Fixed: 673613 Change-Id: Ib3828687ab54fb7a5aad7e97dec46c6e76a7311a Signed-off-by: Ajay Singh Parmar --- drivers/video/msm/mdss/mdss_mdp.c | 2 -- drivers/video/msm/mdss/mdss_mdp_intf_cmd.c | 3 +++ drivers/video/msm/mdss/mdss_mdp_intf_video.c | 4 ++++ drivers/video/msm/mdss/mdss_mdp_intf_writeback.c | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/video/msm/mdss/mdss_mdp.c b/drivers/video/msm/mdss/mdss_mdp.c index 0d28bf7ef91b..0114e0c7f8ef 100644 --- a/drivers/video/msm/mdss/mdss_mdp.c +++ b/drivers/video/msm/mdss/mdss_mdp.c @@ -860,8 +860,6 @@ void mdss_mdp_clk_ctrl(int enable) if (mdata->vsync_ena) mdss_mdp_clk_update(MDSS_CLK_MDP_VSYNC, enable); - mdss_bus_bandwidth_ctrl(enable); - if (!enable) pm_runtime_put(&mdata->pdev->dev); } diff --git a/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c b/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c index 87a552590224..1d2e9b91856a 100644 --- a/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c +++ b/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c @@ -216,6 +216,8 @@ static inline void mdss_mdp_cmd_clk_on(struct mdss_mdp_cmd_ctx *ctx) MDSS_XLOG(ctx->pp_num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); if (!ctx->clk_enabled) { + mdss_bus_bandwidth_ctrl(true); + ctx->clk_enabled = 1; if (cancel_delayed_work_sync(&ctx->pc_work)) pr_debug("deleted pending power collapse work\n"); @@ -273,6 +275,7 @@ static inline void mdss_mdp_cmd_clk_off(struct mdss_mdp_cmd_ctx *ctx) mdss_mdp_ctl_intf_event (ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, (void *)0); mdss_iommu_ctrl(0); + mdss_bus_bandwidth_ctrl(false); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); if ((ctx->panel_on) && (mdata->idle_pc_enabled)) schedule_delayed_work(&ctx->pc_work, diff --git a/drivers/video/msm/mdss/mdss_mdp_intf_video.c b/drivers/video/msm/mdss/mdss_mdp_intf_video.c index 3912d782f251..231df7f05347 100644 --- a/drivers/video/msm/mdss/mdss_mdp_intf_video.c +++ b/drivers/video/msm/mdss/mdss_mdp_intf_video.c @@ -365,6 +365,8 @@ static int mdss_mdp_video_intfs_stop(struct mdss_mdp_ctl *ctl, if (sctl) mdss_mdp_irq_disable(MDSS_MDP_IRQ_INTF_UNDER_RUN, sctl->intf_num); + + mdss_bus_bandwidth_ctrl(false); } list_for_each_entry_safe(handle, tmp, &ctx->vsync_handlers, list) @@ -785,6 +787,8 @@ static int mdss_mdp_video_display(struct mdss_mdp_ctl *ctl, void *arg) mdss_mdp_irq_enable(MDSS_MDP_IRQ_INTF_UNDER_RUN, sctl->intf_num); + mdss_bus_bandwidth_ctrl(true); + mdp_video_write(ctx, MDSS_MDP_REG_INTF_TIMING_ENGINE_EN, 1); wmb(); diff --git a/drivers/video/msm/mdss/mdss_mdp_intf_writeback.c b/drivers/video/msm/mdss/mdss_mdp_intf_writeback.c index c6940976863e..663990f96fb2 100644 --- a/drivers/video/msm/mdss/mdss_mdp_intf_writeback.c +++ b/drivers/video/msm/mdss/mdss_mdp_intf_writeback.c @@ -564,6 +564,7 @@ static int mdss_mdp_wb_wait4comp(struct mdss_mdp_ctl *ctl, void *arg) mdss_mdp_traffic_shaper(ctl, ctx, false); mdss_iommu_ctrl(0); + mdss_bus_bandwidth_ctrl(false); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); /* Set flag to release Controller Bandwidth */ @@ -648,6 +649,7 @@ static int mdss_mdp_writeback_display(struct mdss_mdp_ctl *ctl, void *arg) return ret; } mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); + mdss_bus_bandwidth_ctrl(true); ctx->start_time = ktime_get(); mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_START, 1); wmb();