# Re: mono, gray and index configs

- From: Geert Uytterhoeven \<geert@linux-m68k.org\>
- Date: 2005-08-22 10:18:02 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2005/08/13455420
- Thread: https://ratatoskr.run/linux-fbdev/2005/08/13455364/t.md

```text
On Fri, 19 Aug 2005, Jon Smirl wrote:
> The patch is just for testing, don't send it on. The radeonfb portion
> is definitely not finished.
> 
> This adds an optional function to each driver that advertises what
> configs it offers.
> 
> +char *radeonfb_getconfigs(struct fb_info *info)
> +{
> +	return "I4\nI8\nA1R5G5B5\nR5G6B5\nR8G8B8\nA8R8G8B8\nA4R4G4B4\nA8I8\nA2R10G10B10\n";
> +}
>  
>   static struct fb_ops radeonfb_ops = {
>  	.owner			= THIS_MODULE,
> @@ -1873,6 +1909,7 @@ static struct fb_ops radeonfb_ops = {
>  	.fb_fillrect		= radeonfb_fillrect,
>  	.fb_copyarea		= radeonfb_copyarea,
>  	.fb_imageblit		= radeonfb_imageblit,
> +	.fb_get_configs		= radeonfb_getconfigs,
>  };

Do we really need this?

You can easily write a `probe loop' to find out about all supported configs for
a driver like this:

    for_all_possible_configs(config) {
	struct fb_var_screeninfo var;
	set_up_var(var, config);
	var.activate |= FB_ACTIVATE_TEST;
	if (ioctl(FBIOPUT_VSCREENINFO)) {
	    /* config not supported */
	} else if (config_has_changed(var, config) {
	    /* config not supported */
	} else {
	    /* config is supported */
	}
    }

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
```
