获取色彩深度问题

Mack_liu 2020-01-17 03:33:07
本人最近调试飞凌开发板的显示问题,有问题请教一下:
平台:iMX6DL
内核:3.0.35
在fbmem.c文件中fb_prepare_logo函数中,函数开始获取色深
int fb_prepare_logo(struct fb_info *info, int rotate)
{
//获取当前图片的色深
int depth = fb_get_color_depth(&info->var, &info->fix);
unsigned int yres;
//初始化fb_logo
memset(&fb_logo, 0, sizeof(struct logo_data));
//-------?--start
if (info->flags & FBINFO_MISC_TILEBLITTING ||
info->flags & FBINFO_MODULE)
return 0;

if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
depth = info->var.blue.length;
if (info->var.red.length < depth)
depth = info->var.red.length;
if (info->var.green.length < depth)
depth = info->var.green.length;
}
//-------?--end
if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) {
/* assume console colormap */
depth = 4;
}

/* Return if no suitable logo was found */
fb_logo.logo = fb_find_logo(depth);

上面这部分代码中
int depth = fb_get_color_depth(&info->var, &info->fix);
已经获取了色深在线面为什么还要
        if (info->flags & FBINFO_MISC_TILEBLITTING ||
info->flags & FBINFO_MODULE)
return 0;

if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
depth = info->var.blue.length;
if (info->var.red.length < depth)
depth = info->var.red.length;
if (info->var.green.length < depth)
depth = info->var.green.length;
}
//-------?--end
if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) {
/* assume console colormap */
depth = 4;
}

有懂显示的大牛,麻烦解答一下
...全文
87 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,465

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧