linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Tero Roponen <teanropo@jyu.fi>
Cc: Jordan Crouse <jordan.crouse@amd.com>,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm] fb: modedb uses wrong default_mode
Date: Wed, 15 Nov 2006 15:29:52 -0800	[thread overview]
Message-ID: <20061115152952.0e92c50d.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0611151933070.12799@jalava.cc.jyu.fi>

On Wed, 15 Nov 2006 19:43:16 +0200 (EET)
Tero Roponen <teanropo@jyu.fi> wrote:

> 
> It seems that default_mode is always overwritten in
> fb_find_mode() if caller gives its own modedb; this
> patch should fix it.
> 
> dmesg diff before and after the following patch:
> 
>  neofb: mapped framebuffer at c4a80000
>  -Mode (640x400) won't display properly on LCD
>  -Mode (640x400) won't display properly on LCD
>  -neofb v0.4.2: 2048kB VRAM, using 640x480, 31.469kHz, 59Hz
>  -Console: switching to colour frame buffer device 80x30
>  +neofb v0.4.2: 2048kB VRAM, using 800x600, 37.878kHz, 60Hz
>  +Console: switching to colour frame buffer device 100x37
>   fb0: MagicGraph 128XD frame buffer device
> 
> Signed-off-by: Tero Roponen <teanropo@jyu.fi>
> ---
> 
> --- linux-2.6.19-rc5-mm2/drivers/video/modedb.c.orig	2006-11-15 19:03:03.000000000 +0200
> +++ linux-2.6.19-rc5-mm2/drivers/video/modedb.c	2006-11-15 19:02:57.000000000 +0200
> @@ -507,7 +507,7 @@ int fb_find_mode(struct fb_var_screeninf
>      }
>      if (!default_mode && db != modedb)
>  	default_mode = &db[0];
> -    else
> +    else if (!default_mode)
>  	default_mode = &modedb[DEFAULT_MODEDB_INDEX];
>  
>      if (!default_bpp)

Sigh.

2.6.19-rc5 has:

    if (!default_mode)
	default_mode = &modedb[DEFAULT_MODEDB_INDEX];

and Jordan changed it to

    if (!default_mode && db != modedb)
	default_mode = &db[0];
    else
	default_mode = &modedb[DEFAULT_MODEDB_INDEX];

and you want to change it to

    if (!default_mode && db != modedb)
	default_mode = &db[0];
    else if (!default_mode)
	default_mode = &modedb[DEFAULT_MODEDB_INDEX];

which is actually a complicated way of doing

    if (!default_mode)
	default_mode = &db[DEFAULT_MODEDB_INDEX];

So let's do that.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

       reply	other threads:[~2006-11-15 23:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.64.0611151933070.12799@jalava.cc.jyu.fi>
2006-11-15 23:29 ` Andrew Morton [this message]
2006-11-15 23:44   ` fb: modedb uses wrong default_mode Jordan Crouse
2006-11-17 20:08     ` [Linux-fbdev-devel] " James Simmons
2006-11-17 20:40       ` Andrew Morton
2006-11-18 10:39         ` [Linux-fbdev-devel] " Tero Roponen
2006-11-20 16:48         ` James Simmons
2006-11-20 20:05           ` Andrew Morton
2006-11-20 20:37             ` James Simmons

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=20061115152952.0e92c50d.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jordan.crouse@amd.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=teanropo@jyu.fi \
    /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).