All of
 help / color / mirror / Atom feed
From: Andrew Kephart <>
Subject: Re: [PATCH] fbdev: Fix fb_find_nearest_mode refresh comparison
Date: Mon, 13 Dec 2010 15:46:34 +0000	[thread overview]
Message-ID: <1292255194.12119.1.camel@kephart> (raw)
In-Reply-To: <1292019888.2896.17.camel@kephart>

Refresh rate nearness is not calculated or reset when nearest resolution

This patch resets the refresh rate differential measurement whenever a
new nearest resolution is discovered.  This fixes two error cases;
first, wherein the first mode's refresh rate differential is never
calculated and second, when the closest refresh rate from a previous
nearest resolution is erroneously preserved.

Signed-off-by: Andrew Kephart <>

diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c 
index c3a1825..7a61ba6 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -902,6 +902,7 @@ const struct fb_videomode
*fb_find_nearest_mode(const struct fb_videomode *mode,
                        abs(cmode->yres - mode->yres);
                if (diff > d) {
                        diff = d;
+                       diff_refresh = abs(cmode->refresh -
                        best = cmode;
                } else if (diff = d) {
                        d = abs(cmode->refresh - mode->refresh);

  parent reply	other threads:[~2010-12-13 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10 22:24 [PATCH] fbdev: Fix fb_find_nearest_mode refresh comparison Andrew Kephart
2010-12-11  1:59 ` Paul Mundt
2010-12-13 15:46 ` Andrew Kephart [this message]
2010-12-14  9:05 ` Paul Mundt
2010-12-14 15:58 ` Andrew Kephart

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:

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

  git send-email \
    --in-reply-to=1292255194.12119.1.camel@kephart \ \ \

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.