0ff2c7b1a692888e21fc4e8d8b4f0f11daf22d6c
[openembedded.git] /
1 From 233a6e4f4ccaf5827f04ab38c590397755e61ecb Mon Sep 17 00:00:00 2001
2 From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
3 Date: Mon, 4 May 2009 16:18:30 +0200
4 Subject: [PATCH 60/69] DSS2: Avoid div by zero when calculating required fclk
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=utf-8
7 Content-Transfer-Encoding: 8bit
8
9 When calculating the required fclk rate for five tap filtering if the
10 display width and output width are equal div by zero could occur. The
11 TRM doesn't actually specify how this case should be handled but for
12 now just skip the calculation which would trigger the div by zero.
13
14 Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
15 ---
16  drivers/video/omap2/dss/dispc.c |    2 +-
17  1 files changed, 1 insertions(+), 1 deletions(-)
18
19 diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
20 index f79decb..5fc9457 100644
21 --- a/drivers/video/omap2/dss/dispc.c
22 +++ b/drivers/video/omap2/dss/dispc.c
23 @@ -1399,7 +1399,7 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
24                 do_div(tmp, 2 * out_height * ppl);
25                 fclk = tmp;
26  
27 -               if (height > 2 * out_height) {
28 +               if (height > 2 * out_height && ppl != out_width) {
29                         tmp = pclk * (height - 2 * out_height) * out_width;
30                         do_div(tmp, 2 * out_height * (ppl - out_width));
31                         fclk = max(fclk, (u32) tmp);
32 -- 
33 1.6.2.4
34