cosam
Active Member
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).
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.
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.