fbdev: make the best-fit section of fb_find_mode return the closest matching mode
authorMichal Januszewski <spock@gentoo.org>
Mon, 28 Apr 2008 09:14:48 +0000 (02:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Apr 2008 15:58:35 +0000 (08:58 -0700)
commit6b745b6fd02213f4b2fef2f2635985929fc5b8cc
tree4be3db651080c3008862b8b3604b2c1231a55c27
parent169b6a7a6e91e1ea32136681b475cbaf2074bf35
fbdev: make the best-fit section of fb_find_mode return the closest matching mode

Currently, if a perfect match in terms of resolution is not found,
fb_find_mode() only looks for a best-fit mode among modes with a higher
resolution than the one requested.  Thus, if the user requests a resolution
higher than the largest supported one, they are dropped to the default mode
(usually a low resolution one).

Change this behaviour so that all valid video modes are considered when
looking for a best-fit mode, while still preferring modes with a higher
resolution.

Signed-off-by: Michal Januszewski <spock@gentoo.org>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/modedb.c