OK3568 4.19.206 Implementing Logo Animation Effects
Document classification: □ Top secret □ Secret □ Internal information ■ Open
Copyright
The copyright of this manual belongs to Baoding Folinx Embedded Technology Co., Ltd. Without the written permission of our company, no organizations or individuals have the right to copy, distribute, or reproduce any part of this manual in any form, and violators will be held legally responsible.
Forlinx adheres to copyrights of all graphics and texts used in all publications in original or license-free forms.
The drivers and utilities used for the components are subject to the copyrights of the respective manufacturers. The license conditions of the respective manufacturer are to be adhered to. Related license expenses for the operating system and applications should be calculated/declared separately by the related party or its representatives.
Revision History
Date |
Version |
Revision History |
|---|---|---|
04/08/2022 |
V1.0 |
Initial Version |
Implementing Logo Animation Effects
Prepare Files: A sequence of images for the boot animation.
If the format is PNG:
pngtopnm logo.png > logo.pnm converted to pnm
IIf the format is BMP:
bmptopnm logo.bmp > logo.pnm converted to pnm
Then execute:
pnmquant 224 logo.pnm > logo224.pnm
pnmtoplainpnm logo224.pnm > logo_linux_clut224.ppm
to generate the required PPM format files.
Copy the generated PPM file to the directory OK3568-linux-source/kernel/drivers/video/logo/
Rename it to end with “_clut224.ppm”.

Modify Makefile.

Modify logo.c.

Modify OK3568-linux-source/kernel/include/linux/linux_logo.h.

Modify OK3568-linux-source/arch/arm64/configs/OK3568-C-linux_defconfig to enable the kernel logo.

diff –git a/arch/arm64/configs/OK3568-C-linux_defconfig b/arch/arm64/configs/OK3568-C-linux_defconfig
index 97d46ceff..d5af9f21d 100644
— a/arch/arm64/configs/OK3568-C-linux_defconfig
@@ -590,3 +590,45 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60
CONFIG_FUNCTION_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_LKDTM=y
+
+#
+# Console display driver support
+#
+CONFIG_FONT_8x8=n
+CONFIG_VGA_CONSOLE=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_DUMMY_CONSOLE_COLUMNS=80
+CONFIG_DUMMY_CONSOLE_ROWS=25
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=n
+CONFIG_LOGO_LINUX_VGA16=n
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_PCM_ELD=y
+CONFIG_SND_PCM_IEC958=y
+CONFIG_SND_SEQ_DEVICE=y
+CONFIG_SND_COMPRESS_OFFLOAD=y
+CONFIG_SND_JACK=y
+CONFIG_SND_JACK_INPUT_DEV=y
+# CONFIG_SND_OSSEMUL is not set
+CONFIG_SND_PCM_TIMER=y
+CONFIG_SND_HRTIMER=y
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_MAX_CARDS=32
+# CONFIG_SND_SUPPORT_OLD_API is not set
+CONFIG_SND_PROC_FS=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_DMA_SGBUF=y
+CONFIG_SND_SEQUENCER=y
+CONFIG_SND_SEQ_DUMMY=y
+CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
+CONFIG_SND_DRIVERS=y
Modify OK3568-linux-source/kernel/drivers/video/fbdev/core/fbcon.c
OK3568-linux-source/kernel/drivers/video/fbdev/core/fbmem.c
Adjust logo position and continuous display

diff –git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index bf7959fdf..2607ac9cb 100644
— a/drivers/video/fbdev/core/fbcon.c
@@ -569,6 +569,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);
@@ -2037,6 +2038,8 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
return 0;
}
+extern int fb_get_logo(struct fb_info *info, int rotate);
+
static int fbcon_switch(struct vc_data *vc)
{
struct fb_info *info, *old_info = NULL;
@@ -2158,7 +2161,14 @@ static int fbcon_switch(struct vc_data *vc)
logo_shown = fg_console;
/* This is protected above by initmem_freed */
fb_show_logo(info, ops->rotate);
//fb_show_logo(info, ops->rotate);
+#if 1
for(i = 0; i < 25; i++){fb_get_logo(info, i);
fb_show_logo(info, ops->rotate);
msleep(50);//Sleep 50 ms as the switching interval for displaying pictures
}
+#endif
update_region(vc,
vc->vc_origin + vc->vc_size_row * vc->vc_top,
vc->vc_size_row * (vc->vc_bottom -

diff –git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 7a70e7b80..63cfad4c0 100644
— a/drivers/video/fbdev/core/fbmem.c
@@ -509,10 +509,10 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
fb_set_logo(info, logo, logo_new, fb_logo.depth);
}
image.dx = 0;
image.dy = y; image.width = logo->width; image.height = logo->height;
image.dx = (info->var.xres / 2) - (logo->width / 2);
image.dy = (info->var.yres / 2) - (logo->height / 2);
if (rotate) {
logo_rotate = kmalloc_array(logo->width, logo->height,
@@ -681,12 +681,25 @@ int fb_show_logo(struct fb_info *info, int rotate)
return y;
}
+
+int fb_get_logo(struct fb_info *info, int num)
+{
int depth = fb_get_color_depth(&info->var, &info->fix);
depth |= num << 16;
fb_logo.logo = fb_find_logo(depth);
if(!fb_logo.logo) {return -1;
}
return 0;
+}
#else
int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }
int fb_show_logo(struct fb_info *info, int rotate) { return 0; }
+int fb_get_logo(struct fb_info *info, int rotate) { return 0; }
#endif /* CONFIG_LOGO */
EXPORT_SYMBOL(fb_prepare_logo);
EXPORT_SYMBOL(fb_show_logo);
+EXPORT_SYMBOL(fb_get_logo);
static void *fb_seq_start(struct seq_file *m, loff_t *pos)
{
Modify Ok3568-linux-source/kernel/drivers/video/fbdev/core/bitblit.c and remove the cursor

iff –git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c
index 436365efa..e8e874653 100644
— a/drivers/video/fbdev/core/bitblit.c
@@ -373,7 +373,8 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
if (info->fbops->fb_cursor)
err = info->fbops->fb_cursor(info, &cursor);
if (err)
//if (err)
if (0) soft_cursor(info, &cursor);
ops->cursor_reset = 0;
Refer to https://blog.csdn.net/qq_37596943/article/details/127976078