在安卓系统启动中,会有两个阶段的logo显示,一个是kernel阶段,一个是android阶段
Linux显示开机logo的函数调用:
参考网址
http://www.manongjc.com/detail/15-eihuimkprqaprud.html
1
https://www.cnblogs.com/skyred99/p/5683817.html
1
自己的修改patch
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 42c72d051158…3aafbeee7a65 100644
— a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
/图片居中的修改patch/
@@ -599,6 +599,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
if (fb_get_color_depth(&info->var, &info->fix) == 1)
erase &= ~0x400;
logo_height = fb_prepare_logo(info, ops->rotate);
-
logo_height += (info->var.yres / 2) - (logo_height / 2); logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height); q = (unsigned short *) (vc->vc_origin + vc->vc_size_row * rows);
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 7ecb121c482e…1f8996935b79 100644
— a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -516,12 +516,13 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
image.dx = (xres - n * (logo->width + 8) - 8) / 2;
image.dy = y ?: (yres - logo->height) / 2;
} else {
-
image.dx = 0;
-
image.dy = y;
-
//image.dx = 0;
-
//image.dy = y; }
-
image.width = logo->width; image.height = logo->height; /*info->var.xres,info->var.yres对应屏幕分辨率, image.width ,image.height对应图片logo的分辨率。 */
-
image.dx = (info->var.xres / 2) - (image.width / 2);
-
image.dy = (info->var.yres / 2) - (image.height / 2); if (rotate) { logo_rotate = kmalloc_array(logo->width, logo->height,
@@ -689,12 +690,12 @@ int fb_show_logo(struct fb_info *info, int rotate)
/在linux图标显示会根据cpu的核数进行企鹅数量打印,我们只需要把对应的核数修改为1就ok/
{
unsigned int count;
int y;
if (!fb_logo_count)
return 0;
count = fb_logo_count < 0 ? num_online_cpus() : fb_logo_count;
-
y = fb_show_logo_line(info, rotate, fb_logo.logo, 0, count);