该系列文章总目录链接与各部分简介: Android Qcom Display学习(零)
本章主要就是学习一下开机logo和开机动画是怎么加载,客制化修改的。
Bootlogo
QcomChargerApp.c
QcomChargerApp_MonitorCharging
QcomChargerAppDisplay_DispBattSymbol(DispImageType, TRUE);
QcomChargerApp_PostProcessing
Status |= gBS->LocateProtocol( &gQcomDisplayUtilsProtocolGuid, NULL, (VOID **)&pDisplayUtilsProtocol);
Status |= pDisplayUtilsProtocol->DisplayUtilsRenderLogo(&RenderLogoCfg);
DisplayUtils.c
Display_Utils_RenderLogo
Display_Utils_RenderSplashScreen
//1. from main fv ( GetFileSize)
Status = Display_Utils_LoadFile("logo_720x1280.bmp", &BGRTAddress, &BGRTBufferSize, &ImageSize);
//2. from Image fv (LoadFileFromGuidedFv)
MDP_Display_GetVariable_Integer(DISPVAR_ENABLE_DISPLAY_IMAGEFV, &uImageFvSetting);
uFlags = DISP_LOAD_FILE_FLAG_IMAGEFV;
pLogoFileName = "logo_720x1280.bmp";
Display_Utils_LoadFile(pLogoFileName, &BGRTAddress, &BGRTBufferSize, &ImageSize, uFlags);
不同的平台上实现不一样,默认是load mainfv,有些是支持imagefv,如果支持多个项目不同的开机的logo,在main fv中添加会导致大小增大并延长启动时间,此时就可放入imagefv中,默认支持可以看路径(boot_images/boot/QcomPkg/Docs/CustomSplashLogo.txt),
有些平台是默认是不支持的,添加loadimagefv(ImageFv.txt)的代码也无法实现从imagefv中获取图片,返回的一直是(RETURN_NOT_FOUND),问高通说有些分支在UEFI Core中没有合入关键代码, 所以要实现得向高通申请patch。
main fv
boot_images/QcomPkg/SocPkg/KamortaPkg/LAA/uefiplat.cfg
0x5FC00000, 0x00300000, "UEFI FD", AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK
UEFI FD最大的size为0x00300000 = 3MB
boot_images/QcomPkg/SocPkg/KamortaPkg/LAA/Core.fdf
[FD.Kamorta_EFI]
BaseAddress = 0x5FC00000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress #The base address of the FLASH Device.
Size = 0x002B2E00|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH Device
ErasePolarity = 1
BlockSize = 0x200
NumBlocks = 0x1597
# 512 bytes of configuration header & 8 bytes of image header
0x00000000|0x002B2E00
FILE FREEFORM = 8cfbb887-c16f-4859-a897-539a723c77d6 {
SECTION UI = "logo_720x1280.bmp"
SECTION RAW = QcomPkg/Logo/LA/logo_720x1280.bmp
}
<partition label="xbl_a" size_in_kb="3604" type="DEA0BA2C-CBDD-4805-B4F9-F428251C3E98"
uniqueguid="A54CD18E-48E6-11EB-A809-4B8A186A3B98" bootable="false" readonly="true" filename="xbl.elf"/>
当前UEFI FD的size为0x002B2E00,需确保要小于cfg中定义的大小3MB,若需增加则NumBlocks也需要增加(Size/BlockSize)
imagefv
boot_images/boot/QcomPkg/SocPkg/Kodiak/Common/uefiplat.cfg
0x9C700000, 0x03100000, "DXE Heap", AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN
ImageFv的内存通过DXE堆动态分配,ImageFv的增量取决与可用的空闲空间
EnableDisplayImageFv = 0x1
boot_images/boot/QcomPkg/SocPkg/Kodiak/LAA/ImageFv.fdf.inc
FILE FREEFORM = 9dc745c1-2c8d-43fd-8956-c18de6511b97 {
SECTION UI = "logo_720x1280.bmp"
SECTION RAW = QcomPkg/Logo/LA/logo_720x1280.bmp
}
[FV.IMAGEFV_COMPACT]
BlockSize = 0x1000
NumBlocks = 0x5
<partition label="imagefv_b" size_in_kb="2048" type="77036CD4-03D5-42BB-8ED1-37E5A88BAA34"
uniqueguid="CD55DD56-48E6-11EB-B48F-4F6E1099088C" bootable="false" readonly="false" system="true" filename=""/>
增加ImageFV的size大小,则增大NumBlocks的大小,需保证小于cfg中的DXE Heap定义的大小以及分区大小
必要的可能还需要更改分区表partition.xml,需要通过qfil刷入,如果是release的产品是无法通过OTA的方式去改分区的
Animation
frameworks/base/cmds/bootanimation/BootAnimation.cpp,制作bootanimation需要注意一下几点
(1)desc.txt最后一行必须回车
1280 720 5 宽 高 帧率
p 1 0 part0 标识符 重复次数 两次显示间隔
p 0 0 part1 p:会被中断 c:等待动画完成 0:循环 1:重复一次
(2)直接将part0 part1 desc.txt进行打包,不要在外层打包
(3)打包的格式一定要注意(仅存储),不然就会出现,bootanimation.zip is compressed; must be only stored