Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SAIL-IMX6q user Guide-- modify boot LOGO

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1 modify LOGO in u-boot

Replace the logo

Replace the freescale.bmp in the u-boot-imx/2015.04-r0/git/tools/logos/ directory. Note that the image to be replaced here must be a bitmap with 256colors. If it is a 24-bit color image conversion, there may be errors, resulting in abnormal picture display. We can also directly put the file we need to display is not named freescale.bmp, then we need to modify the u-boot-imx/2015.04-r0/git/tools/Makefile file and set the path behind LOGO_BMP= to the name of our picture. When compiling, bmp_logo will convert the images we specified into array files and save them in bmp_logo.h and bmp_logo_data.h in the / u-boot-imx/2015.04-r0/git/mx6qsabresd_config/include/ directory

2 display the picture in the center

Modify u-boot-imx/2015.04-r0/git/drivers/video/cfb_console.c in function static

Modified in void * video_logo (void)

Splash_get_pos (& video_logo_xpos, & video_logo_ypos)

If (video_logo_xpos==0&&video_logo_ypos==0) / / here is the added code to set the picture to center the display

{

Video_logo_xpos= (VIDEO_VISIBLE_COLS-BMP_LOGO_WIDTH) > > 1

Video_logo_ypos= (VIDEO_VISIBLE_ROWS-BMP_LOGO_HEIGHT) > > 1

}

3 remove the compilation information

In the function static

Comment out the following code in the void * video_logo (void) function

Sprintf (info, "% s", version_string)

Space = (VIDEO_COLS-VIDEO_INFO_X) / VIDEO_FONT_WIDTH

Len = strlen (info)

If (len > space) {

Int xx = VIDEO_INFO_X, yy = VIDEO_INFO_Y

Uchar p = (uchar) info

While (len) {

If (len > space) {

Video_drawchars (xx,yy, p, space)

Len-= space

P = (uchar *) p + space

If (! y_off) {

Xx + = VIDEO_FONT_WIDTH

Space--

}

Yy + = VIDEO_FONT_HEIGHT

Yearly offending +

} else {

Video_drawchars (xx, yy, p, len)

Len = 0

}

}

} else

Video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, (uchar *) info)

2 modify the logo started by Linux

1 generate logo file

To generate the logo file, we need to convert the png image to run the following command in terminal: pngtopnm car.png > car.pnm # convert png to pnm format pnmquant 224

Car.pnm > car224.pnm # convert number of pixels to 224

Pnmtoplainpnmcar224.pnm > logo_car_clut224.ppm

2 copy logo_car_clut224.ppm to the / kernel-source/drivers/video/logo/ directory

3 increase under / kernel-source/drivers/video/logo/Kconfig

Config LOGO_CAR224

Bool "Standard car logo"

Default y

Add under / kernel-source/drivers/video/logo/Makefile

Obj-$ (CONFIG_LOGO_CAR224) + = logo_car_clut224.o

4 execute bitbake-c menuconfig-v linux-imx

Select Standard car logo in menuconfig

5 in / kernel-source/drivers/video/logo/logo.c

Const struct linux_logo *

In the _ _ init_refok fb_find_logo (int depth) function

If (depth > = 8) {

.

}

Add inside

# ifdef CONFIG_LOGO_CAR224

/ Generic car logo /

Logo = & logo_car_clut224

# endif

Add externconst struct linux_logo logo_car_clut224 to / kernel-source/include/linux/linux_logo.h

6 remove the display logo according to the number of CPU, and display only one logo

The function intfb_show_logo (struct fb_info * info, int rotate) in / kernel-source/drivers/video/fbmem.c changes y = fb_show_logo_line (info, rotate, fb_logo.logo, 0)

Num_online_cpus ()

Change to

Y = fb_show_logo_line (info, rotate, fb_logo.logo, 0

/ num_online_cpus () / 1)

7 set logo center display

Modify the / kernel-source/drivers/video/fbmem.c

Static voidfb_do_show_logo (struct fb_info info, struct fb_image image

Int rotate, unsigned

Int num) function

The code is as follows:

Unsigned int x

Unsigned intxoff,yoff

/ / added code to set the logo center display

Xoff = (info- > var.xres-num * (fb_logo.logo- > width)) > > 1

Yoff = (info- > var.yres-(fb_logo.logo- > height)) > > 1

/ / /

If (rotate = = FB_ROTATE_UR) {

/ / added code to set the logo center display

Image- > dx = xoff

Image- > dy = yoff

/ /

For (x = 0)

X

< num && image->

Dx + image- > width var.xres

Xexamples +) {

Info- > fbops- > fb_imageblit (info,image)

Printk (KERN_ALERT "end\ n")

Image- > dx + = image- > width + 8

}

}

Modify the function int fb_prepare_logo (struct fb_info * info, int rotate) at the end of the function

Returnfb_prepare_extra_logos (info, fb_logo.logo- > height, yres)

Change to

Returnfb_prepare_extra_logos (info, fb_logo.logo- > height, yres) + (info- > var.yres) > > 1)

Recompile and you're done.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report