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

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

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).

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.

-- 
Michal Januszewski                                Gentoo Linux Developer
cell: +48504917690                         http://dev.gentoo.org/~spock/
JID: spock@im.gentoo.org               freenode: #gentoo-dev, #gentoo-pl


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-10-13 19:37 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 [this message]
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=20051013193650.GA17760@spock.one.pl \
    --to=spock@gentoo.org \
    --cc=adaplas@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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