msm_fb: display: fix division-by-zero bug

Panel v_back_porch could be zero for virtual panels, so the check for
zero is added to fix the bug.

Change-Id: I6a29f3d8d771092bca2374cc9a1c11dd77ad569e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
This commit is contained in:
Huaibin Yang 2012-09-04 13:31:29 -07:00 committed by Iliyan Malchev
parent 38351d4a0a
commit 2764083d28

View file

@ -2616,7 +2616,8 @@ static int mdp4_calc_pipe_mdp_clk(struct msm_fb_data_type *mfd,
* required(FIR).
*/
if ((mfd->panel_info.lcdc.v_back_porch <= 4) &&
(pipe->src_h != pipe->dst_h)) {
(pipe->src_h != pipe->dst_h) &&
(mfd->panel_info.lcdc.v_back_porch)) {
u32 clk = 0;
clk = 4 * (pclk >> shift) / mfd->panel_info.lcdc.v_back_porch;
clk <<= shift;