pseuduo_palette in the framebuffer info structure of LinuxKernel

135 views Asked by At

I want to configure my frame buffer driver for 24-bit RGB, I could see pseudo_palette in fb_info structure. can you please tell me what is the use of pseudo_palette member in fb_info structure.

Following is function assigned to "fb_setcolreg" call back function of fb_ops structure in the existing driver. Do I need to change anything in the following function for 24-bit or 32-bit framebuffer configuration.

static int lcdif_fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp,struct fb_info *fbi)
{
        unsigned int val;
        int ret = 1;

        /*
         * If greyscale is true, then we convert the RGB value
         * to greyscale 
         */
        if (fbi->var.grayscale)
                red = green = blue = (19595 * red + 38470 * green +
                                7471 * blue) >> 16;
        switch (fbi->fix.visual) {
                case FB_VISUAL_TRUECOLOR:
                        /*
                         * 16-bit True Colour.
                         */
                        if (regno < 16) {
                                u32 *pal = fbi->pseudo_palette;


                                val = _chan_to_field(red, &fbi->var.red);
                                val |= _chan_to_field(green, &fbi->var.green);
                                val |= _chan_to_field(blue, &fbi->var.blue);

                                pal[regno] = val;
                                ret = 0;

                        }
                        break;

                case FB_VISUAL_STATIC_PSEUDOCOLOR:
                case FB_VISUAL_PSEUDOCOLOR:
                        break;
        }
        return ret;
}
0

There are 0 answers