Qualcomm 如何修改lk 开机logo

现在的LCD屏大部分都是mipi cmd模式的了, 对于静态画面, mipi主控只需要刷新一次就可以了,因此现在大部分手机的boot logo的第一画面应该是放在lk下吧.

那么如何修改呢

1 首先得拿到图片,这个图片一般是从公司负责GUI 的那边获取到,格式要求是png, 色深8bit,  且不带alpha(透明色)通道的


2 将 png文件转换成raw文件

convert android.png -depth 8 rgb:android.raw

3 对于某些屏(只支持RGB565才需要此步骤),将raw文件转换成565格式的raw文件, Android 自带了一个这样的工具,在out/host/linux-x86/bin

./rgb2565 android.raw android.raw565


4 将android.raw或android.raw565转换成原始数组

xxd -i android.raw565 > android_logo.h
xxd -i android.raw > android_logo.h

然后用生成的数组替换掉splash.h中的imageBuffer_rgb888数组即可.

如下代码展示了如何在屏幕上面显示两个不同的小图片

\bootable\bootloader\lk\pla\msm_shared\include\splash.h

<span style="font-size:14px;">#define SPLASH_IMAGE_GIGASET_WIDTH  680
#define SPLASH_IMAGE_GIGASET_HEIGHT	210
#define SPLASH_IMAGE_GIGASET_H_OFFSET 200
#define SPLASH_IMAGE_GIGASET_V_OFFSET  568

#define SPLASH_IMAGE_ANDROID_WIDTH 	432
#define SPLASH_IMAGE_ANDROID_HEIGHT 118
#define SPLASH_IMAGE_ANDROID_H_OFFSET 324
#define SPLASH_IMAGE_ANDROID_V_OFFSET 1724

static char imageBufferGigaset_rgb888[] = 
{
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
.....
};

//york.zhang@swdp.system  2015/05/29 added  for  modify LK logo
static char imageBufferAndroid_rgb888[] = 
{
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, .....
};



</span>


bootable\bootloader\lk\dev\fbcon\fbcon.c
<span style="font-size:14px;">#ifdef GIGASET_EDIT
void fbcon_putGigset(struct fbimage *fbimg) 	
{
    unsigned i = 0;
    unsigned bytes_per_bpp;
    unsigned image_base;
    unsigned width = 0; 
	unsigned pitch = 0;
	unsigned height = 0;
    unsigned char *logo_base = NULL;
    struct logo_img_header *header;



	if (!config) {
		dprintf(CRITICAL,"NULL configuration, image cannot be displayed\n");
		return;
	}

	if(fbimg) {
		header = &fbimg->header;
		width = pitch = header->width;
		height = header->height;
		logo_base = (unsigned char *)fbimg->image;
	}

	bytes_per_bpp = ((config->bpp) / 8);

	if(bytes_per_bpp == 3)
	{
		image_base = (SPLASH_IMAGE_GIGASET_V_OFFSET ) * (config->width) + (config->width-width)/2;		


		for (i = 0; i < height; i++) {
			memcpy (config->base + ((image_base + (i * (config->width))) * bytes_per_bpp),
				logo_base + (i * pitch * bytes_per_bpp), width * bytes_per_bpp);
		}
	}	
}


void fbcon_putAndroid(struct fbimage *fbimg) 	
{
    unsigned i = 0;
    unsigned bytes_per_bpp;
    unsigned image_base;
    unsigned width = 0; 
	unsigned pitch = 0; 
	unsigned height = 0;
    unsigned char *logo_base = NULL;
    struct logo_img_header *header;



	if (!config) {
		dprintf(CRITICAL,"NULL configuration, image cannot be displayed\n");
		return;
	}

	if(fbimg) {
		header = &fbimg->header;
		width = pitch = header->width;
		height = header->height;
		logo_base = (unsigned char *)fbimg->image;
	}

	bytes_per_bpp = ((config->bpp) / 8);

	if(bytes_per_bpp == 3)
	{
		image_base = (SPLASH_IMAGE_ANDROID_V_OFFSET) * (config->width) + (config->width- width)/2;		

		for (i = 0; i < height; i++) {
			memcpy (config->base + ((image_base + (i * (config->width))) * bytes_per_bpp),
				logo_base + (i * pitch * bytes_per_bpp), width * bytes_per_bpp);
		}
	
		arch_clean_invalidate_cache_range((addr_t) config->base, ((config->width) * (config->height) * bytes_per_bpp));
	}
	
	fbcon_flush();

}
#endif


void display_image_on_screen()
{
	struct fbimage default_fbimg, *fbimg;
	bool flag = true;

	fbcon_clear();
	fbimg = fetch_image_from_partition();

	if(!fbimg) {
		flag = false;
		fbimg = &default_fbimg;

		//york.zhang@swdp.system   2015/05/29  deleted for modify oem panel logo
		#ifndef GIGASET_EDIT
		fbimg->header.width = SPLASH_IMAGE_WIDTH;
		fbimg->header.height = SPLASH_IMAGE_HEIGHT;
		#endif

		
		
#if DISPLAY_TYPE_MIPI

		//york.zhang@swdp.system   2015/05/29  modified for modify oem panel logo
		#ifdef GIGASET_EDIT 

		fbimg->header.width = SPLASH_IMAGE_GIGASET_WIDTH;
		fbimg->header.height = SPLASH_IMAGE_GIGASET_HEIGHT;
		fbimg->image = (unsigned char *)imageBufferGigaset_rgb888;
		fbcon_putGigset(fbimg);



		fbimg->header.width = SPLASH_IMAGE_ANDROID_WIDTH;
		fbimg->header.height = SPLASH_IMAGE_ANDROID_HEIGHT;
		fbimg->image = (unsigned char *)imageBufferAndroid_rgb888;				
		fbcon_putAndroid(fbimg);
		#else
		fbimg->image = (unsigned char *)imageBuffer_rgb888;
		#endif
#else
		fbimg->image = (unsigned char *)imageBuffer;
#endif
	}

	//york.zhang@swdp.system   2015/05/29  deleted for modify oem panel logo
	#ifndef GIGASET_EDIT
	fbcon_putImage(fbimg, flag);
	#endif
	if (flag)
		free(fbimg);
}</span>




  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提供的源码资源涵盖了Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 适合毕业设计、课程设计作业。这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。 所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值