gradients
Jon Smirl
jonsmirl at gmail.com
Thu May 19 08:01:55 PDT 2005
I needed this code, radeonfb is always a DirectColor display and the
palettes don't get automatically initialized. They get cleared on
every mode set. My fbdev egl driver seem to be working right now but
it definitely needs some clean up on mode setting.
if (fixedInfo.visual == FB_VISUAL_DIRECTCOLOR) {
struct fb_cmap cmap;
unsigned short red[256], green[256], blue[256];
int rcols = 1 << varInfo.red.length;
int gcols = 1 << varInfo.green.length;
int bcols = 1 << varInfo.blue.length;
int i;
cmap.start = 0;
cmap.len = gcols;
cmap.red = red;
cmap.green = green;
cmap.blue = blue;
cmap.transp = NULL;
for (i = 0; i < rcols ; i++)
red[i] = (65536/(rcols-1)) * i;
for (i = 0; i < gcols ; i++)
green[i] = (65536/(gcols-1)) * i;
for (i = 0; i < bcols ; i++)
blue[i] = (65536/(bcols-1)) * i;
if (ioctl(fd, FBIOPUTCMAP, (void *) &cmap) < 0) {
fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i);
exit(1);
}
}
--
Jon Smirl
jonsmirl at gmail.com
More information about the dri-egl
mailing list