8Bbp Paletted Frame Buffer Possible?


cosam

Active Member
Joined
Sep 1, 2008
Messages
703
Location
Netherlands
Website
www.cosam.org
I'm trying to set up an 8bpp frame buffer on the Pandora but I'm not having any luck. The fbset utility takes the argument fine, and the FBIOGET_VSCREENINFO ioctl says it's set to 8bpp, but the display repeats itself like it's set to 16 or even 32 bits (I get four images horizontally and two vertically). I've also not been able to set the palette; the ioctl in the code below return errors about bad file descriptors and/or invalid arguments (sorry, I don't have the actual output with me, but will post later if necessary).

Code:
struct fb_cmap fbcmap;
unsigned char *c = (unsigned char *)palette;
unsigned short red[256];
unsigned short green[256];
unsigned short blue[256];
int i = 0;

if( !fb_dev )
	return;

fbcmap.start = 0;
fbcmap.len = 256;
fbcmap.red = red;
fbcmap.green = green;
fbcmap.blue = blue;
fbcmap.transp = NULL;

for( i = 0 ; i < 256 ; i++ ) {
	blue[i] = *c++;
	green[i] = *c++;
	red[i] = *c++;
	c++;
}

if( ioctl(fb_dev, FBIOPUTCMAP, &fbcmap) != -1 ) {
	fprintf(stderr, "Error setting frame buffer (%d) palette: %s\n", fb_dev, strerror(errno));
}

Am I doing something stupid or is this simply not supported at some level? If the latter, will it ever be supported? I am faking it right now using 16bpp and my own look-up table.
 
I thought we currently do not support 8bpp on the fb (it never really worked for me when I tried it anyway :)

I just asked notaz, and he clarifies the driver does have some code in there for it, but we've not tested it. YMMV.

jeff
 
Fair enough. Would be nice to have the option for completeness' sake, but the workaround is fine for now. Maybe worth disabling 8bpp somehow so folk get a error, instead of things being reported as available when they're not?
 
Back
Top