lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1184229085.4504.29.camel@daplas>
Date:	Thu, 12 Jul 2007 16:31:25 +0800
From:	"Antonino A. Daplas" <adaplas@...il.com>
To:	spock@...too.org, linux-fbdev-devel@...ts.sourceforge.net
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [Linux-fbdev-devel] [PATCH 1/4] fbdev: make fb_find_mode look
	for a mode with the	highest refresh rate

On Sat, 2007-06-23 at 12:50 +0200, Michal Januszewski wrote:
> 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@...too.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;

How about..?

	if (!refresh_specified)
		diff = 0;
	else
		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;
>  					}
then
					if (diff < db[i].refresh) {
						diff = db[i].refresh;
						best = i;
					}

Tony


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ