LinuxKernel的帧缓冲区信息结构中的pseuduo_调色板
我想为24位RGB配置帧缓冲区驱动程序,我可以在fb_信息结构中看到伪_调色板。 你能告诉我在fb_信息结构中伪_调色板成员的用途吗 以下是分配给现有驱动程序中fb_ops结构的“fb_setcolreg”回调功能的功能。对于24位或32位帧缓冲区配置,是否需要更改以下函数中的任何内容LinuxKernel的帧缓冲区信息结构中的pseuduo_调色板,linux,linux-kernel,framebuffer,Linux,Linux Kernel,Framebuffer,我想为24位RGB配置帧缓冲区驱动程序,我可以在fb_信息结构中看到伪_调色板。 你能告诉我在fb_信息结构中伪_调色板成员的用途吗 以下是分配给现有驱动程序中fb_ops结构的“fb_setcolreg”回调功能的功能。对于24位或32位帧缓冲区配置,是否需要更改以下函数中的任何内容 static int lcdif_fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp,struct fb_info
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;
}
static int lcdif\u fb\u setcolreg(u\u int regno、u\u int red、u\u int green、u\u int blue、u\u int transp、struct fb\u info*fb)
{
无符号int-val;
int-ret=1;
/*
*如果灰度为真,则转换RGB值
*灰阶
*/
如果(fbi->变量灰度)
红色=绿色=蓝色=(19595*红色+38470*绿色+
7471*蓝色)>>16;
开关(fbi->fix.visual){
案例FB_视觉_真彩色:
/*
*16位真彩色。
*/
if(regno<16){
u32*pal=fbi->pseudo_调色板;
val=_chan_to_字段(红色,&fbi->var.red);
val |=_chan_to_字段(绿色,&fbi->var.green);
val |=_chan_to_字段(蓝色,&fbi->var.blue);
pal[regno]=val;
ret=0;
}
打破
案例FB_视觉_静态_伪彩色:
案例FB_视觉_伪彩色:
打破
}
返回ret;
}