Hi, I have a Linux Framebuffer working OK with 256 colors (8bpp). The great thing is that support is already built in the library. The odd thing is that it is not 'activated', and I don't know why.
File vd_lnxfb.c, function build_video_mode, add this: ... switch( fbvar.bits_per_pixel ) { case 8: mp->bpp = 8; ep->mode = GR_frameSVGA8_LFB; ep->flags |= GR_VMODEF_LINEAR; ep->cprec[0] = fbvar.red.length; ep->cprec[1] = fbvar.green.length; ep->cprec[2] = fbvar.blue.length; ep->cpos[0] = fbvar.red.offset; ep->cpos[1] = fbvar.green.offset; ep->cpos[2] = fbvar.blue.offset; break; ..... And that's all. Now you have support for 8 bpp framebuffer. I have a 4bpp (16 colors) framebuffer too. If anyone is interested ask me directly. Some time ago I offered it to be included as standard driver in grx, but nobody was interested.
I've added support for palette too, and is working for me. But this is an embedded hardware, and I'm not sure that it works for everyone:
static void loadcolor( int c, int r, int g, int b ) { __u16 red, green, blue, transp; struct fb_cmap cmap; red = (r << 8); green =(g << 8); blue = (b << 8); transp = 0; cmap.start = c; cmap.len = 1; cmap.red = &red; cmap.green = &green; cmap.blue = &blue; cmap.transp = &transp; ioctl(fbfd, FBIOPUTCMAP, &cmap); }
For this function to be called, in the function build_video_mode replace ep->loadcolor = NULL; with ep->loadcolor = loadcolor;
Excuse me, Mariano. I wanted to talk with you about those things, but I've been (and I am) VERY pressed and I simply forgot it.
Regards,
Josu
-----Mensaje original----- De: Mariano Alvarez Fernandez [SMTP:malfer@telefonica.net] Enviado el: sábado 7 de diciembre de 2002 21:47 Para: Wolfgang Schilling CC: grx@gnu.de Asunto: Re: need help
Wolfgang Schilling wrote:
Dear sirs, my first trial with GRX245 failed. After making and installing without svgalib-support the Linux console framebuffer driver cannot be found. But the direct access to the fb device (/dev/fb0) works fine. Setting with GrSetDriver(drvspec) with drvspec="linuxfb gw 800 gh 600 nc 256"
Please post the output of the "lfbinfo" program here. But I tink the problem is you have set the framebuffer with 8 bpp (256 colors), and the GRX framebuffer driver only knows about 16, 24 and 32 bpp modes.
M.Alvarez