高通平台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

相关文章

Python实现精准提取 PDF中的文本,表格与图片

《Python实现精准提取PDF中的文本,表格与图片》在实际的系统开发中,处理PDF文件不仅限于读取整页文本,还有提取文档中的表格数据,图片或特定区域的内容,下面我们来看看如何使用Python实... 目录安装 python 库提取 PDF 文本内容:获取整页文本与指定区域内容获取页面上的所有文本内容获取

canal实现mysql数据同步的详细过程

《canal实现mysql数据同步的详细过程》:本文主要介绍canal实现mysql数据同步的详细过程,本文通过实例图文相结合给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的... 目录1、canal下载2、mysql同步用户创建和授权3、canal admin安装和启动4、canal

MySQL存储过程之循环遍历查询的结果集详解

《MySQL存储过程之循环遍历查询的结果集详解》:本文主要介绍MySQL存储过程之循环遍历查询的结果集,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录前言1. 表结构2. 存储过程3. 关于存储过程的SQL补充总结前言近来碰到这样一个问题:在生产上导入的数据发现

SpringBoot集成LiteFlow实现轻量级工作流引擎的详细过程

《SpringBoot集成LiteFlow实现轻量级工作流引擎的详细过程》LiteFlow是一款专注于逻辑驱动流程编排的轻量级框架,它以组件化方式快速构建和执行业务流程,有效解耦复杂业务逻辑,下面给大... 目录一、基础概念1.1 组件(Component)1.2 规则(Rule)1.3 上下文(Conte

Python基于微信OCR引擎实现高效图片文字识别

《Python基于微信OCR引擎实现高效图片文字识别》这篇文章主要为大家详细介绍了一款基于微信OCR引擎的图片文字识别桌面应用开发全过程,可以实现从图片拖拽识别到文字提取,感兴趣的小伙伴可以跟随小编一... 目录一、项目概述1.1 开发背景1.2 技术选型1.3 核心优势二、功能详解2.1 核心功能模块2.

Go语言如何判断两张图片的相似度

《Go语言如何判断两张图片的相似度》这篇文章主要为大家详细介绍了Go语言如何中实现判断两张图片的相似度的两种方法,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 在介绍技术细节前,我们先来看看图片对比在哪些场景下可以用得到:图片去重:自动删除重复图片,为存储空间"瘦身"。想象你是一个

使用Python实现base64字符串与图片互转的详细步骤

《使用Python实现base64字符串与图片互转的详细步骤》要将一个Base64编码的字符串转换为图片文件并保存下来,可以使用Python的base64模块来实现,这一过程包括解码Base64字符串... 目录1. 图片编码为 Base64 字符串2. Base64 字符串解码为图片文件3. 示例使用注意

Spring Boot 整合 Apache Flink 的详细过程

《SpringBoot整合ApacheFlink的详细过程》ApacheFlink是一个高性能的分布式流处理框架,而SpringBoot提供了快速构建企业级应用的能力,下面给大家介绍Spri... 目录Spring Boot 整合 Apache Flink 教程一、背景与目标二、环境准备三、创建项目 & 添

RedisTemplate默认序列化方式显示中文乱码的解决

《RedisTemplate默认序列化方式显示中文乱码的解决》本文主要介绍了SpringDataRedis默认使用JdkSerializationRedisSerializer导致数据乱码,文中通过示... 目录1. 问题原因2. 解决方案3. 配置类示例4. 配置说明5. 使用示例6. 验证存储结果7.

pytest+allure环境搭建+自动化实践过程

《pytest+allure环境搭建+自动化实践过程》:本文主要介绍pytest+allure环境搭建+自动化实践过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录一、pytest下载安装1.1、安装pytest1.2、检测是否安装成功二、allure下载安装2.