linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] fbdev: make fb_find_mode look for a mode with the highest refresh rate
@ 2007-06-23 10:50 Michal Januszewski
  2007-06-23 18:04 ` Andrew Morton
  2007-07-12  8:31 ` Antonino A. Daplas
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Januszewski @ 2007-06-23 10:50 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: linux-kernel

If the refresh rate hasn't been explicitly specified, fd_find_mode
currently returns the first mode with the requested resolution. Change
it so that it returns a mode with the requested resolution and the
highest refresh rate.

Also export fb_destroy_modelist, which is used in uvesafb.

Signed-off-by: Michal Januszewski <spock@gentoo.org>
---
drivers/video/modedb.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 3741ad7..98ee77b 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -606,16 +606,18 @@ done:
 	DPRINTK("Trying specified video mode%s %ix%i\n",
 	    refresh_specified ? "" : " (ignoring refresh rate)", xres, yres);
 
+	if (!refresh_specified)
+		refresh = 200;
 	diff = refresh;
 	best = -1;
 	for (i = 0; i < dbsize; i++) {
 		if (name_matches(db[i], name, namelen) ||
 		    (res_specified && res_matches(db[i], xres, yres))) {
 			if(!fb_try_mode(var, info, &db[i], bpp)) {
-				if(!refresh_specified || db[i].refresh == refresh)
+				if (refresh_specified && db[i].refresh == refresh)
 					return 1;
 				else {
-					if(diff > abs(db[i].refresh - refresh)) {
+					if (diff > abs(db[i].refresh - refresh)) {
 						diff = abs(db[i].refresh - refresh);
 						best = i;
 					}
@@ -938,6 +940,7 @@ void fb_destroy_modelist(struct list_head *head)
 		kfree(pos);
 	}
 }
+EXPORT_SYMBOL_GPL(fb_destroy_modelist);
 
 /**
  * fb_videomode_to_modelist: convert mode array to mode list



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-12  8:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-23 10:50 [PATCH 1/4] fbdev: make fb_find_mode look for a mode with the highest refresh rate Michal Januszewski
2007-06-23 18:04 ` Andrew Morton
2007-06-23 21:26   ` Michal Januszewski
2007-07-12  8:34   ` Antonino A. Daplas
2007-07-12  8:31 ` Antonino A. Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).