From: hjc Date: Wed, 2 Apr 2014 09:58:14 +0000 (+0800) Subject: rk fb: fix rk_fb_get_prmry_screen_ft cal error X-Git-Tag: firefly_0821_release~5637 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aef4c720a80d0e5a84b17c2b20dfda0175bf6b1b;p=firefly-linux-kernel-4.4.55.git rk fb: fix rk_fb_get_prmry_screen_ft cal error --- diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 905b3195119f..9e94ea056722 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -528,20 +528,19 @@ static struct rk_lcdc_driver *rk_get_prmry_lcdc_drv(void) int rk_fb_get_prmry_screen_ft(void) { struct rk_lcdc_driver *dev_drv = rk_get_prmry_lcdc_drv(); - uint32_t htotal, vtotal, pix_total, ft_us, dclk_mhz; + uint32_t htotal, vtotal, pix_total, ft_us, pixclock_ns; if (unlikely(!dev_drv)) return 0; - dclk_mhz = dev_drv->pixclock/(1000*1000); + pixclock_ns = dev_drv->pixclock/1000; htotal = (dev_drv->cur_screen->mode.upper_margin + dev_drv->cur_screen->mode.lower_margin + dev_drv->cur_screen->mode.yres + dev_drv->cur_screen->mode.vsync_len); vtotal = (dev_drv->cur_screen->mode.left_margin + dev_drv->cur_screen->mode.right_margin + dev_drv->cur_screen->mode.xres + dev_drv->cur_screen->mode.hsync_len); - pix_total = htotal*vtotal; - ft_us = pix_total / dclk_mhz; - + pix_total = htotal*vtotal/1000; + ft_us = pix_total * pixclock_ns; return ft_us; }