msm_fb: display: add mdp clk rate calculation for low vbp
For the panels that have low v_back_porch, if h/w FIR scaling is used,
during vbp time, mdp clk should be fast enough to output a line from 4
input lines. MDP rate equation for very small scaling, e.g. 1 or 2
pixels' upscaling or downscaling cannot cover this case, where
underruns are seen on those panels.
Change-Id: I4f35f98c2c1bc4ef04dfee193427bd3ff674945d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
diff --git a/drivers/video/msm/mdp4_overlay.c b/drivers/video/msm/mdp4_overlay.c
index 9ad3a05..b12ec94 100644
--- a/drivers/video/msm/mdp4_overlay.c
+++ b/drivers/video/msm/mdp4_overlay.c
@@ -2534,6 +2534,22 @@
rst >>= shift;
/*
+ * There is one special case for the panels that have low
+ * v_back_porch (<=4), mdp clk should be fast enough to buffer
+ * 4 lines input during back porch time if scaling is
+ * required(FIR).
+ */
+ if ((mfd->panel_info.lcdc.v_back_porch <= 4) &&
+ (pipe->src_h != pipe->dst_h)) {
+ u32 clk = 0;
+ clk = 4 * (pclk >> shift) / mfd->panel_info.lcdc.v_back_porch;
+ clk <<= shift;
+ pr_debug("%s: mdp clk rate %d based on low vbp %d\n",
+ __func__, clk, mfd->panel_info.lcdc.v_back_porch);
+ rst = (rst > clk) ? rst : clk;
+ }
+
+ /*
* If the calculated mdp clk is less than panel pixel clk,
* most likely due to upscaling, mdp clk rate will be set to
* greater than pclk. Now the driver uses 1.15 as the
@@ -3634,4 +3650,3 @@
mutex_unlock(&mfd->dma->ov_mutex);
return err;
}
-