From: Jon Smirl Date: Wed, 27 Jul 2005 18:46:03 +0000 (-0700) Subject: [PATCH] fbmon: horizontal frequency rounding fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a793b77f786022bd0fef1a18142c1b9be9e421d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] fbmon: horizontal frequency rounding fix Fix rounding error when mode frequency is very close to monitor limit Signed-off-by: Jon Smirl Acked-by: James Simmons Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c index 6cd1976548d4..c2718bb94949 100644 --- a/drivers/video/fbmon.c +++ b/drivers/video/fbmon.c @@ -1241,6 +1241,8 @@ int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info) vtotal *= 2; hfreq = pixclock/htotal; + hfreq = (hfreq + 500) / 1000 * 1000; + vfreq = hfreq/vtotal; return (vfreq < vfmin || vfreq > vfmax ||