Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a793b77 authored by Jon Smirl's avatar Jon Smirl Committed by Linus Torvalds
Browse files

[PATCH] fbmon: horizontal frequency rounding fix



Fix rounding error when mode frequency is very close to monitor limit

Signed-off-by: default avatarJon Smirl <jonsmirl@gmail.com>
Acked-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4e4b7952
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1241,6 +1241,8 @@ int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info)
		vtotal *= 2;
		vtotal *= 2;


	hfreq = pixclock/htotal;
	hfreq = pixclock/htotal;
	hfreq = (hfreq + 500) / 1000 * 1000;

	vfreq = hfreq/vtotal;
	vfreq = hfreq/vtotal;


	return (vfreq < vfmin || vfreq > vfmax || 
	return (vfreq < vfmin || vfreq > vfmax ||