From dc9efbd9ff504381da4ddd669f0beb12477ada1d Mon Sep 17 00:00:00 2001 From: Siddhartha Agrawal Date: Fri, 11 Jan 2013 12:32:18 -0800 Subject: [PATCH] msm_fb:display: correct bus bw for downscale case The check condition for updating bus bandwidth if downscaling is needed was always FALSE. Change-Id: Iec0a4d13c7737d86976d76e0dfd3ec45062799fd Signed-off-by: Siddhartha Agrawal Signed-off-by: Huaibin Yang --- drivers/video/msm/mdp4_overlay.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/msm/mdp4_overlay.c b/drivers/video/msm/mdp4_overlay.c index d21211d4aa82..0a29898b2af1 100644 --- a/drivers/video/msm/mdp4_overlay.c +++ b/drivers/video/msm/mdp4_overlay.c @@ -2650,13 +2650,13 @@ static int mdp4_calc_pipe_mdp_bw(struct msm_fb_data_type *mfd, /* factor 1.25 for ib */ pipe->bw_ib_quota = quota * MDP4_BW_IB_FACTOR / 100; /* down scaling factor for ib */ - if ((!pipe->dst_h) && (!pipe->src_h) && + if ((pipe->dst_h) && (pipe->src_h) && (pipe->src_h > pipe->dst_h)) { - u64 ib = quota; + u32 ib = quota; ib *= pipe->src_h; ib /= pipe->dst_h; - pipe->bw_ib_quota = max(ib, pipe->bw_ib_quota); - pr_debug("%s: src_h=%d dst_h=%d mdp ib %llu, ib_quota=%llu\n", + pipe->bw_ib_quota = max((u64)ib, pipe->bw_ib_quota); + pr_debug("%s: src_h=%d dst_h=%d mdp ib %u, ib_quota=%llu\n", __func__, pipe->src_h, pipe->dst_h, ib<bw_ib_quota<