summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonghan Ryu <dryu@nvidia.com>2011-06-15 15:57:57 +0900
committerYuhao Ding <yding@nvidia.com>2011-06-17 17:11:21 -0700
commit8917a5603a3e6534d6c75ed0d91077062805b111 (patch)
tree56d88868c719b44203fa3a927b8350ec3cf743c9
parentae5cbd7bd05d46ac11169b32345d3937bc4b3717 (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. back-ported from kernel.org Change-Id: I9f1062153efbc546d4c97d627032f6ef48992387 Reviewed-on: http://git-master/r/36662 Reviewed-by: Donghan Ryu <dryu@nvidia.com> Tested-by: Donghan Ryu <dryu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-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 930070e3ccf4..f0696a72563f 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -1308,6 +1308,7 @@ const struct fb_videomode *fb_find_nearest_mode(const struct fb_videomode *mode,
abs(cmode->yres - mode->yres);
if (diff > d) {
diff = d;
+ diff_refresh = abs(cmode->refresh - mode->refresh);
best = cmode;
} else if (diff == d) {
d = abs(cmode->refresh - mode->refresh);