[Linux-fbdev-devel] [PATCH] video: Get the default mode from the right database

Geert Uytterhoeven geert at linux-m68k.org
Tue Oct 3 03:04:38 EDT 2006


On Mon, 2 Oct 2006, Jordan Crouse wrote:
> fb_find_mode() is behaving in an non-intuitive way.  When I specify my
> own video mode database, and no default mode, I would have expected it
> to assume the first mode in my database as the default mode.  Instead, it
> uses the built in database:
> 
> > if (!db) {
> >     db = modedb;
> >     dbsize = ARRAY_SIZE(modedb);
> > }
> > if (!default_mode)
> >     default_mode = &modedb[DEFAULT_MODEDB_INDEX];
> 
> Personally, I think this is incorrect - if an alternate database is
> specified, it should be always using that.  Patch is attached.

> --- a/drivers/video/modedb.c
> +++ b/drivers/video/modedb.c
> @@ -506,7 +506,7 @@ int fb_find_mode(struct fb_var_screeninf
>  	dbsize = ARRAY_SIZE(modedb);
>      }
>      if (!default_mode)
> -	default_mode = &modedb[DEFAULT_MODEDB_INDEX];
> +	default_mode = &db[DEFAULT_MODEDB_INDEX];
>      if (!default_bpp)
>  	default_bpp = 8;

Although currently DEFAULT_MODEDB_INDEX is defined to be 0, perhaps we need a
more rigorous check now it may apply to the custom video mode database?
Probably you always want the first mode of your custom video mode database to
be the default?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds



More information about the Devel mailing list