linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew Kephart" <andrew.kephart@alereon.com>
To: linux-fbdev@vger.kernel.org
Subject: [PATCH] fbdev: Fix fb_find_nearest_mode refresh comparison
Date: Fri, 10 Dec 2010 22:24:48 +0000	[thread overview]
Message-ID: <1292019888.2896.17.camel@kephart> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 1132 bytes --]

Refresh rate nearness is not calculated or reset when nearest resolution
changes.

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.

-andrew


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 -  mode->refresh);
                        best = cmode;
                } else if (diff = d) {
                        d = abs(cmode->refresh - mode->refresh);

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±ýöÝzÿâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&£ûàz¿äz¹Þ—ú+€Ê+zf£¢·hšˆ§~†­†Ûiÿÿïêÿ‘êçz_è®\x0fæj:+v‰¨þ)ߣøm

             reply	other threads:[~2010-12-10 22:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10 22:24 Andrew Kephart [this message]
2010-12-11  1:59 ` [PATCH] fbdev: Fix fb_find_nearest_mode refresh comparison Paul Mundt
2010-12-13 15:46 ` Andrew Kephart
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:
  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=1292019888.2896.17.camel@kephart \
    --to=andrew.kephart@alereon.com \
    --cc=linux-fbdev@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).