From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Michal Januszewski <spock@gentoo.org>
Cc: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH] fbdev: fix the fb_find_nearest_mode() function
Date: Fri, 14 Oct 2005 08:18:08 +0800 [thread overview]
Message-ID: <434EF940.9020608@gmail.com> (raw)
In-Reply-To: <20051013193650.GA17760@spock.one.pl>
Michal Januszewski wrote:
> On Mon, Oct 10, 2005 at 04:21:51PM +0800, Antonino A. Daplas wrote:
>
>>> 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?
>
> This is something I had to use in a driver I'm currently working on and
> I thought it might be a good idea to include it in the patch I sent.
>
> The thing is, if the var struct has the pixclock field set to 0,
> mode->refresh is left untouched, which could mean that it's either
> set to a random value or to an invalid refresh rate coming from a
> previously processed videomode (in case the fb_videomode struct is
> reused).
Ok.
>
> I actually dealt with modes with var->pixclock == 0, and it always resulted
> in a getting U:<xres>x<yres>-<random> in /sys/class/graphics/fb0/modes.
>
> In case you're wondering why would anyone ever need to have
> var->pixclock set to 0 -- I was using it to denote modes with a default
> refresh rate set by the hardware (well, the Video BIOS to be more
> specific). Please let me know is this is very wrong, but I just didn't
> see any other way of doing it.
No, it's not wrong. But it is preferrable to have a nonzero value in
var->pixclock (whether calculated or via a VBE function call).
Still, I agree with you to initialize mode->refresh to zero (or perhaps
-1 to to denote a divide by zero) for these cases.
Tony
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
next prev parent reply other threads:[~2005-10-14 0:18 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
2005-10-13 19:36 ` Michal Januszewski
2005-10-14 0:18 ` Antonino A. Daplas [this message]
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=434EF940.9020608@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 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.