Skip to content

Commit

Permalink
[PATCH] fbmon: horizontal frequency rounding fix
Browse files Browse the repository at this point in the history
Fix rounding error when mode frequency is very close to monitor limit

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jon Smirl authored and Linus Torvalds committed Jul 27, 2005
1 parent 4e4b795 commit 0a793b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/video/fbmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit 0a793b7

Please sign in to comment.