aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/modedb.c
diff options
context:
space:
mode:
authorAndrew Kephart <andrew.kephart@alereon.com>2010-12-13 10:46:34 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-12-14 04:03:49 -0500
commite504b84805c574cf18d705c610c9e4a8f6e61017 (patch)
tree94b9f060a2dcde8efb171b5ab5c514cfb0c445f0 /drivers/video/modedb.c
parent6313e3c21743cc88bb5bd8aa72948ee1e83937b6 (diff)
fbdev: Fix fb_find_nearest_mode refresh comparison
Refresh rate nearness is not calculated or reset when nearest resolution changes. This patch resets the refresh rate differential measurement whenever a new nearest resolution is discovered. This fixes two error cases; first, wherein the first mode's refresh rate differential is never calculated and second, when the closest refresh rate from a previous nearest resolution is erroneously preserved. Signed-off-by: Andrew Kephart <andrew.kephart@alereon.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/modedb.c')
-rw-r--r--drivers/video/modedb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 0a4dbdc1693a..de450c1fb869 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -855,6 +855,7 @@ const struct fb_videomode *fb_find_nearest_mode(const struct fb_videomode *mode,
855 abs(cmode->yres - mode->yres); 855 abs(cmode->yres - mode->yres);
856 if (diff > d) { 856 if (diff > d) {
857 diff = d; 857 diff = d;
858 diff_refresh = abs(cmode->refresh - mode->refresh);
858 best = cmode; 859 best = cmode;
859 } else if (diff == d) { 860 } else if (diff == d) {
860 d = abs(cmode->refresh - mode->refresh); 861 d = abs(cmode->refresh - mode->refresh);