OK6254-C Development Board LVDS Screen Replacement Logo Solution

Posted by Andy L.
6
Nov 13, 2024
29 Views

LVDS Screen Logo Display Optimization

The LVDS display's driver, panel-lvds, is compiled as a module by default. During boot, module-type drivers are loaded later, causing the LVDS display to initialize later, and it takes around 20 seconds for the desktop to appear on the LVDS screen.

To initialize the LVDS display earlier, you need to compile the LVDS driver into the kernel, allowing it to initialize earlier.

The main modification can be made by compiling panel-lids.c directly into the kernel in the OK6254-C_defconfig file.

OK6254-linux-sdk/OK6254-linux-kernel/arch/arm64/configs/OK6254-C_defconfig
CONFIG_DRM_PANEL_LVDS=y

And then carry out full compilation and flashing. Start after burning, LVDS will display the penguin logo about 10 seconds after starting. Here is how to replace the penguin logo with other logos.

Replace Penguin Logo With Custom Logo

First, find the location of the penguin logo as follows:

The penguin logo image used on the TI AM6254 platform is called logo _ ti _ clut224.ppm. Here's how to replace the image with a custom logo.

Note: The logo resolution cannot exceed the resolution of the LVDS screen, and the background color should be black. Take 1280x800 as an example. Here is a 1280x800 resolution picture made by the drawing software under windows, preferably in PNG format. If it is a picture in other formats, please convert it to PNG format first and then perform the following operations. (myilogo.png)

OK6254-C Development Board LVDS Screen Replacement Logo Solution

Put it anywhere on the virtual machine, and convert it to the format needed, with the following command:

pngtopnm mylogo.png > my_linux_logo.pnm
pnmquant 224 my_linux_logo.pnm > my_linux_logo_224.pnm
pnmtoplainpnm my_linux_logo_224.pnm > my_linux_logo_224.ppm

After converting the image to ppm format, copy the resulting image in ppm format to the path where the penguin logo is located. Then we convert the image in ppm format to a.c file, where we use the pnmtologo tool under the path (if you report a permission error, add sudo before the command).

./pnmtologo -t clut224 -n logo_ti_clut224 -o logo_ti_clut224.c
my_linux_logo_224.ppm

Realize logo centered display

1. Modify the fb_show_logo_line function in source code /driver/video/fbdev/core/fbmem.c.

//image.dx=0;
//image.dy=y;
image.width=logo->width;
image.height=logo->height;
image.dx = (info->var.xres / 2) - (image.width / 2);
image.dy = (info->var.yres / 2) - (image.height / 2);

Description:

The image. dx and image. dy variables are used to set the top-left corner of the image on the screen. The info-> var.xres and info-> var.yres variables represent the horizontal and vertical resolution of the screen, respectively. The image.width and image.height variables represent the width and height of the flag image, respectively. image. dx is calculated to center the image horizontally on the screen by subtracting half the image's width from half the screen's width. image. dy is calculated to vertically center the image on the screen by subtracting half the height of the image from half the height of the screen. Overall, this code centers the logo image horizontally and vertically on the screen.

2. Modify the source code/driver/video/fbdev/core/fbcon.c中的fbcon_prepare_logo() function.

After logo_height = fb_prepare_logo(info, ops->rotate); add the following line of code

logo_height += (info->var.yres / 2) - (logo_height / 2);

Now you can compile and burn it. If you are only in the debug phase, you can compile the kernel separately and replace the Image. It can also be fully compiled and then burned.

Note: If the logo is not centered or not displayed, check whether the LCD screen has been turned off, otherwise the resolution of the LCD screen will prevail.

Common issues 1

Image has more than 224 colors
Use ppmquant(1) to reduce the number of colors

Solutions

ppmquant 224 logo_ti_clut224.ppm > logo_ti_clut224_224.ppm

Common issues 2

logo_ti_clut224.ppm: Binary PNM is not supported
Use pnmnoraw(1) to convert it to ASCII PNM

Solutions

pnmnoraw logo_ti_clut224_224.ppm > logo_ti_clut224_ascii.ppm

Folinx Embedded Logo Replacement

After startup, before entering the desktop, the Forlinx logo will be displayed for a while, and this logo will be replaced with custom logo in the following way.

First, the image is saved in the following path in the file system:

/usr/share/weston/2-1280x800.png

Just replace the file with custom logo, still named 2-1280x800.png, and the format must be PNG.


Dear friends, we have created an exclusive embedded technical exchange group on Facebook, where our experts share the latest technological trends and practical skills. Join us and grow together!

Comments
avatar
Please sign in to add comment.