高通平台bootloader显示logo图片的过程

2024-05-27 11:48

本文主要是介绍高通平台bootloader显示logo图片的过程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

platform:  mtk8937

以下为开机后调用关系:

根据不同的平台,这个函数所在的文件不同; 我们项目属于msm8952系列;

void target_display_init(const char *panel_name)
{struct oem_panel_data oem;int32_t ret = 0;uint32_t panel_loop = 0;set_panel_cmd_string(panel_name);oem = mdss_dsi_get_oem_data();if (!strcmp(oem.panel, NO_PANEL_CONFIG)|| !strcmp(oem.panel, SIM_VIDEO_PANEL)|| !strcmp(oem.panel, SIM_CMD_PANEL)|| oem.skip) {dprintf(INFO, "Selected panel: %s\nSkip panel configuration\n",oem.panel);return;}do {target_force_cont_splash_disable(false);ret = gcdb_display_init(oem.panel, MDP_REV_50, (void *)MIPI_FB_ADDR);if (!ret || ret == ERR_NOT_SUPPORTED) {break;} else {target_force_cont_splash_disable(true);msm_display_off();}} while (++panel_loop <= oem_panel_max_auto_detect_panels());if (!oem.cont_splash) {dprintf(INFO, "Forcing continuous splash disable\n");target_force_cont_splash_disable(true);}
}

再调用以下函数:

int gcdb_display_init(const char *panel_name, uint32_t rev, void *base)
{int ret = NO_ERROR;int pan_type;dsi_video_mode_phy_db.pll_type = DSI_PLL_TYPE_28NM;pan_type = oem_panel_select(panel_name, &panelstruct, &(panel.panel_info),&dsi_video_mode_phy_db);if (pan_type == PANEL_TYPE_DSI) {if (update_dsi_display_config())goto error_gcdb_display_init;target_dsi_phy_config(&dsi_video_mode_phy_db);mdss_dsi_check_swap_status();mdss_dsi_set_pll_src();if (dsi_panel_init(&(panel.panel_info), &panelstruct)) {dprintf(CRITICAL, "DSI panel init failed!\n");ret = ERROR;goto error_gcdb_display_init;}panel.panel_info.mipi.mdss_dsi_phy_db = &dsi_video_mode_phy_db;panel.pll_clk_func = mdss_dsi_panel_clock;panel.dfps_func = mdss_dsi_mipi_dfps_config;panel.power_func = mdss_dsi_panel_power;panel.pre_init_func = mdss_dsi_panel_pre_init;panel.bl_func = mdss_dsi_bl_enable;panel.dsi2HDMI_config = mdss_dsi2HDMI_config;/** Reserve fb memory to store pll codes and pass* pll codes values to kernel.*/panel.panel_info.dfps.dfps_fb_base = base;base += DFPS_PLL_CODES_SIZE;panel.fb.base = base;dprintf(SPEW, "dfps base=0x%p,d, fb_base=0x%p!\n",panel.panel_info.dfps.dfps_fb_base, base);panel.fb.width =  panel.panel_info.xres;panel.fb.height =  panel.panel_info.yres;panel.fb.stride =  panel.panel_info.xres;panel.fb.bpp =  panel.panel_info.bpp;panel.fb.format = panel.panel_info.mipi.dst_format;} else if (pan_type == PANEL_TYPE_EDP) {mdss_edp_panel_init(&(panel.panel_info));/* prepare func is set up at edp_panel_init */panel.clk_func = mdss_edp_panel_clock;panel.power_func = mdss_edp_panel_power;panel.bl_func = mdss_edp_bl_enable;panel.fb.format = FB_FORMAT_RGB888;} else {dprintf(CRITICAL, "Target panel init not found!\n");ret = ERR_NOT_SUPPORTED;goto error_gcdb_display_init;}panel.fb.base = base;panel.mdp_rev = rev;ret = msm_display_init(&panel);error_gcdb_display_init:display_enable = ret ? 0 : 1;return ret;
}

再调用下面函数: //  配置lcd.

int msm_display_init(struct msm_fb_panel_data *pdata)
{int ret = NO_ERROR;panel = pdata;if (!panel) {ret = ERR_INVALID_ARGS;goto msm_display_init_out;}/* Turn on panel */if (pdata->power_func)ret = pdata->power_func(1, &(panel->panel_info));if (ret)goto msm_display_init_out;if (pdata->dfps_func)ret = pdata->dfps_func(&(panel->panel_info));/* Enable clock */if (pdata->clk_func)ret = pdata->clk_func(1, &(panel->panel_info));if (ret)goto msm_display_init_out;/* Read specifications from panel if available.* If further clocks should be enabled, they can be enabled* using pll_clk_func*/if (pdata->update_panel_info)ret = pdata->update_panel_info();if (ret)goto msm_display_init_out;/* Enabled for auto PLL calculation or to enable* additional clocks*/if (pdata->pll_clk_func)ret = pdata->pll_clk_func(1, &(panel->panel_info));if (ret)goto msm_display_init_out;/* pinfo prepare  */if (pdata->panel_info.prepare) {/* this is for edp which pinfo derived from edid */ret = pdata->panel_info.prepare();panel->fb.width =  panel->panel_info.xres;panel->fb.height =  panel->panel_info.yres;panel->fb.stride =  panel->panel_info.xres;panel->fb.bpp =  panel->panel_info.bpp;}if (ret)goto msm_display_init_out;ret = msm_fb_alloc(&(panel->fb));if (ret)goto msm_display_init_out;fbcon_setup(&(panel->fb));display_image_on_screen();if ((panel->dsi2HDMI_config) && (panel->panel_info.has_bridge_chip))ret = panel->dsi2HDMI_config(&(panel->panel_info));if (ret)goto msm_display_init_out;ret = msm_display_config();if (ret)goto msm_display_init_out;ret = msm_display_on();if (ret)goto msm_display_init_out;if (pdata->post_power_func)ret = pdata->post_power_func(1);if (ret)goto msm_display_init_out;/* Turn on backlight */if (pdata->bl_func)ret = pdata->bl_func(1);if (ret)goto msm_display_init_out;msm_display_init_out:return ret;
}

再调用,下面函数;

void display_image_on_screen(void)
{
#if DISPLAY_TYPE_MIPIint fetch_image_from_partition();dprintf(INFO, "display_image_on_screen-1\n");if (fetch_image_from_partition() < 0) {display_default_image_on_screen();} else {/* data has been put into the right place */fbcon_flush();}
#elsedisplay_default_image_on_screen();
#endif
}

再调用显示logo函数:

void display_default_image_on_screen(void)
{unsigned i = 0;unsigned total_x;unsigned total_y;unsigned bytes_per_bpp;unsigned image_base;
#if DISPLAY_TYPE_MIPIchar *image = NULL;
#endifif (!config) {dprintf(CRITICAL,"NULL configuration, image cannot be displayed\n");return;}fbcon_clear(); // clear screen with Black colortotal_x = config->width;total_y = config->height;bytes_per_bpp = ((config->bpp) / 8);image_base = ((((total_y/2) - (SPLASH_IMAGE_HEIGHT / 2) - 1) *(config->width)) + (total_x/2 - (SPLASH_IMAGE_WIDTH / 2)));#if DISPLAY_TYPE_MIPI
#if ENABLE_WBCimage = (pm_appsbl_charging_in_progress() ? image_batt888 : imageBuffer_rgb888);
#elseimage = imageBuffer_rgb888;
#endifif (bytes_per_bpp == 3) {for (i = 0; i < SPLASH_IMAGE_HEIGHT; i++) {memcpy (config->base + ((image_base + (i * (config->width))) * bytes_per_bpp),image + (i * SPLASH_IMAGE_WIDTH * bytes_per_bpp),SPLASH_IMAGE_WIDTH * bytes_per_bpp);}}fbcon_flush();
#if DISPLAY_MIPI_PANEL_NOVATEK_BLUEif(is_cmd_mode_enabled())mipi_dsi_cmd_mode_trigger();
#endif#elseif (bytes_per_bpp == 2) {for (i = 0; i < SPLASH_IMAGE_HEIGHT; i++) {memcpy (config->base + ((image_base + (i * (config->width))) * bytes_per_bpp),imageBuffer + (i * SPLASH_IMAGE_WIDTH * bytes_per_bpp),SPLASH_IMAGE_WIDTH * bytes_per_bpp);}}fbcon_flush();
#endif
}

在以上函数中,fbcon_clear() 是清屏。

	fbcon_clear();  // clear screen with Black color
        config->width;  // screen total width
        config->height  // screen total high
        image_base      // 显示的screen的中心基准。

改变这个image_base 的中心基准值,可以改变图片的显示位置。


这篇关于高通平台bootloader显示logo图片的过程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1007390

相关文章

C#中图片如何自适应pictureBox大小

《C#中图片如何自适应pictureBox大小》文章描述了如何在C#中实现图片自适应pictureBox大小,并展示修改前后的效果,修改步骤包括两步,作者分享了个人经验,希望对大家有所帮助... 目录C#图片自适应pictureBox大小编程修改步骤总结C#图片自适应pictureBox大小上图中“z轴

SpringBoot 整合 Grizzly的过程

《SpringBoot整合Grizzly的过程》Grizzly是一个高性能的、异步的、非阻塞的HTTP服务器框架,它可以与SpringBoot一起提供比传统的Tomcat或Jet... 目录为什么选择 Grizzly?Spring Boot + Grizzly 整合的优势添加依赖自定义 Grizzly 作为

使用Python将长图片分割为若干张小图片

《使用Python将长图片分割为若干张小图片》这篇文章主要为大家详细介绍了如何使用Python将长图片分割为若干张小图片,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1. python需求的任务2. Python代码的实现3. 代码修改的位置4. 运行结果1. Python需求

mysql-8.0.30压缩包版安装和配置MySQL环境过程

《mysql-8.0.30压缩包版安装和配置MySQL环境过程》该文章介绍了如何在Windows系统中下载、安装和配置MySQL数据库,包括下载地址、解压文件、创建和配置my.ini文件、设置环境变量... 目录压缩包安装配置下载配置环境变量下载和初始化总结压缩包安装配置下载下载地址:https://d

springboot整合gateway的详细过程

《springboot整合gateway的详细过程》本文介绍了如何配置和使用SpringCloudGateway构建一个API网关,通过实例代码介绍了springboot整合gateway的过程,需要... 目录1. 添加依赖2. 配置网关路由3. 启用Eureka客户端(可选)4. 创建主应用类5. 自定

最新版IDEA配置 Tomcat的详细过程

《最新版IDEA配置Tomcat的详细过程》本文介绍如何在IDEA中配置Tomcat服务器,并创建Web项目,首先检查Tomcat是否安装完成,然后在IDEA中创建Web项目并添加Web结构,接着,... 目录配置tomcat第一步,先给项目添加Web结构查看端口号配置tomcat    先检查自己的to

SpringBoot集成SOL链的详细过程

《SpringBoot集成SOL链的详细过程》Solanaj是一个用于与Solana区块链交互的Java库,它为Java开发者提供了一套功能丰富的API,使得在Java环境中可以轻松构建与Solana... 目录一、什么是solanaj?二、Pom依赖三、主要类3.1 RpcClient3.2 Public

Android数据库Room的实际使用过程总结

《Android数据库Room的实际使用过程总结》这篇文章主要给大家介绍了关于Android数据库Room的实际使用过程,详细介绍了如何创建实体类、数据访问对象(DAO)和数据库抽象类,需要的朋友可以... 目录前言一、Room的基本使用1.项目配置2.创建实体类(Entity)3.创建数据访问对象(DAO

SpringBoot整合kaptcha验证码过程(复制粘贴即可用)

《SpringBoot整合kaptcha验证码过程(复制粘贴即可用)》本文介绍了如何在SpringBoot项目中整合Kaptcha验证码实现,通过配置和编写相应的Controller、工具类以及前端页... 目录SpringBoot整合kaptcha验证码程序目录参考有两种方式在springboot中使用k

电脑显示hdmi无信号怎么办? 电脑显示器无信号的终极解决指南

《电脑显示hdmi无信号怎么办?电脑显示器无信号的终极解决指南》HDMI无信号的问题却让人头疼不已,遇到这种情况该怎么办?针对这种情况,我们可以采取一系列步骤来逐一排查并解决问题,以下是详细的方法... 无论你是试图为笔记本电脑设置多个显示器还是使用外部显示器,都可能会弹出“无HDMI信号”错误。此消息可能