Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: Michal Januszewski <spock@gentoo.org>
Subject: Re: [PATCH] fbdev: fix the fb_find_nearest_mode() function
Date: Mon, 10 Oct 2005 16:21:51 +0800	[thread overview]
Message-ID: <434A249F.4060503@gmail.com> (raw)
In-Reply-To: <20051009092949.GA9610@spock.one.pl>

Michal Januszewski wrote:
> Currently the fb_find_nearest_mode() function finds a mode with
> screen resolution closest to that described by the 'var' argument
> and with some arbitrary refresh rate (eg. in the following sequence
> of refresh rates: 70 60 53 85 75, 53 is selected).
> 
> This patch fixes the function so that it looks for the closest mode as 
> far as both resolution and refresh rate are concerned. The function's
> first argument is changed to fb_videomode so that the refresh rate can
> be specified by the caller, as fb_var_screeninfo doesn't have any fields
> that could directly hold this data.
> 

I like it. I always wanted to fix this but I keep on forgetting :-)

> Signed-off-by: Michal Januszewski <spock@gentoo.org>
> ---
> 
> diff -Nurp fbdev-orig/drivers/video/console/fbcon.c fbdev/drivers/video/console/fbcon.c
> --- fbdev-orig/drivers/video/console/fbcon.c	2005-10-08 23:14:29.000000000 +0200
> +++ fbdev/drivers/video/console/fbcon.c	2005-10-09 01:03:22.000000000 +0200
> @@ -2758,7 +2758,7 @@ static void fbcon_new_modelist(struct fb
>  			continue;
>  		vc = vc_cons[i].d;
>  		display_to_var(&var, &fb_display[i]);
> -		mode = fb_find_nearest_mode(&var, &info->modelist);
> +		mode = fb_find_nearest_mode(fb_display[i].mode, &info->modelist);
>  		fb_videomode_to_var(&var, mode);
>  
>  		if (vc)
> diff -Nurp fbdev-orig/drivers/video/modedb.c fbdev/drivers/video/modedb.c
> --- fbdev-orig/drivers/video/modedb.c	2005-10-08 23:14:29.000000000 +0200
> +++ fbdev/drivers/video/modedb.c	2005-10-09 01:25:16.000000000 +0200
> @@ -663,6 +663,7 @@ void fb_var_to_videomode(struct fb_video
>  {
>  	u32 pixclock, hfreq, htotal, vtotal;
>  
> +	mode->refresh = 0;

Any reason why you need to set mode->refresh to 0?

Tony


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

  reply	other threads:[~2005-10-10  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-09  9:29 [PATCH] fbdev: fix the fb_find_nearest_mode() function Michal Januszewski
2005-10-10  8:21 ` Antonino A. Daplas [this message]
2005-10-13 19:36   ` Michal Januszewski
2005-10-14  0:18     ` Antonino A. Daplas
2005-10-14 15:04       ` Michal Januszewski

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=434A249F.4060503@gmail.com \
    --to=adaplas@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=spock@gentoo.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