改写fb_do_show_logo函数。呵呵。
static void fb_do_show_logo(struct fb_info *info,struct fb_image *image,int rotate)
{
u32 *palette = NULL, *saved_pseudo_palette = NULL;
int x,xoffset;
int y,yoffset;
/**for central logo**/
xoffset = (info->var.xres - num_online_cpus() * (fb_logo.logo->width + 8))>>1;
yoffset = (info->var.yres - num_online_cpus() * (fb_logo.logo->height + 8))>>1;
if (xoffset<0) xoffset = 0;
if (yoffset<0) yoffset =0;
for (x = xoffset,y=yoffset; x < num_online_cpus() * (fb_logo.logo->width + 8) + xoffset
&& x <= info->var.xres-fb_logo.logo->width+xoffset &&y<num_online_cpus()*(fb_logo.logo->height+8)+yoffset&&y<=info->var.yres-fb_logo.logo->height+yoffset; x += (fb_logo.logo->width + 8),y+=(fb_logo.logo->height+8) )
{
image->dx = x;
image->dy = y;
info->fbops->fb_imageblit(info, image);
}
kfree(palette);
if (saved_pseudo_palette != NULL)
info->pseudo_palette = saved_pseudo_palette;
}
linux logo显示LCD屏幕中央的解决方案。
最新推荐文章于 2021-04-30 14:05:12 发布