linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Januszewski <spock@gentoo.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fbdev-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] fbdev: make fb_find_mode look for a mode with the	highest refresh rate
Date: Sat, 23 Jun 2007 23:26:32 +0200	[thread overview]
Message-ID: <20070623212632.GA7148@spock.one.pl> (raw)
In-Reply-To: <20070623110424.9a68d82d.akpm@linux-foundation.org>

On Sat, Jun 23, 2007 at 11:04:24AM -0700, Andrew Morton wrote:
> On Sat, 23 Jun 2007 12:50:46 +0200 Michal Januszewski <spock@gentoo.org> wrote:
> 
> > +	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);
> >  
> 
> fbdev ignoramus asks: isn't this pretty risky?  People who were previously
> relying upon (or at least using) the kernel's default resolution will find
> their displays coming up in a quite different resolution.

The resolution will be unchanged (this part of the code is only executed
if either the name of the mode or the resolution are a match).

What can change is the refresh rate -- it can be set higher than what it
used to be before.  But since we're checking all modes with fb_try_mode(),
(which calls fb_check_var()), I think that this change should be safe.
 
To avoid any side effects we could also do the following:

	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)
					return 1;
				else {
					if (diff > abs(db[i].refresh - refresh)) {
						diff = abs(db[i].refresh - refresh);
						best = i;
					}
				}
			}
		}
	}

	if (best != -1) {
		fb_try_mode(var, info, &db[best], bpp);
-		return 2;
+ 		return (refresh_specified) ? 2 : 1;
	}

which would ensure that 1 is returned if the refresh rate is not
explicitly specified, just as it is done currently:

				if(!refresh_specified || db[i].refresh == refresh)
					return 1

I might be missing something here, so it would be nice if someone
involved in the fb development could comment on the proposed change.

> This change seems to be quite unrelated to the uvesafb stuff and should be
> in a separate patch from the export, which _is_ uvesafb-related.  I think. 
> If that's wrong then the changelog could do with some attention.

You're right, I'll split this into two patches in the next round.

Best regards,
Michal


-------------------------------------------------------------------------
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/

  reply	other threads:[~2007-06-23 21:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2007-07-12  8:34   ` Antonino A. Daplas
2007-07-12  8:31 ` Antonino A. Daplas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070623212632.GA7148@spock.one.pl \
    --to=spock@gentoo.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).