高通平台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实现网格交易策略的过程

《Python实现网格交易策略的过程》本文讲解Python网格交易策略,利用ccxt获取加密货币数据及backtrader回测,通过设定网格节点,低买高卖获利,适合震荡行情,下面跟我一起看看我们的第一... 网格交易是一种经典的量化交易策略,其核心思想是在价格上下预设多个“网格”,当价格触发特定网格时执行买

python设置环境变量路径实现过程

《python设置环境变量路径实现过程》本文介绍设置Python路径的多种方法:临时设置(Windows用`set`,Linux/macOS用`export`)、永久设置(系统属性或shell配置文件... 目录设置python路径的方法临时设置环境变量(适用于当前会话)永久设置环境变量(Windows系统

python运用requests模拟浏览器发送请求过程

《python运用requests模拟浏览器发送请求过程》模拟浏览器请求可选用requests处理静态内容,selenium应对动态页面,playwright支持高级自动化,设置代理和超时参数,根据需... 目录使用requests库模拟浏览器请求使用selenium自动化浏览器操作使用playwright

Mysql中设计数据表的过程解析

《Mysql中设计数据表的过程解析》数据库约束通过NOTNULL、UNIQUE、DEFAULT、主键和外键等规则保障数据完整性,自动校验数据,减少人工错误,提升数据一致性和业务逻辑严谨性,本文介绍My... 目录1.引言2.NOT NULL——制定某列不可以存储NULL值2.UNIQUE——保证某一列的每一

解密SQL查询语句执行的过程

《解密SQL查询语句执行的过程》文章讲解了SQL语句的执行流程,涵盖解析、优化、执行三个核心阶段,并介绍执行计划查看方法EXPLAIN,同时提出性能优化技巧如合理使用索引、避免SELECT*、JOIN... 目录1. SQL语句的基本结构2. SQL语句的执行过程3. SQL语句的执行计划4. 常见的性能优

linux下shell脚本启动jar包实现过程

《linux下shell脚本启动jar包实现过程》确保APP_NAME和LOG_FILE位于目录内,首次启动前需手动创建log文件夹,否则报错,此为个人经验,供参考,欢迎支持脚本之家... 目录linux下shell脚本启动jar包样例1样例2总结linux下shell脚本启动jar包样例1#!/bin

java内存泄漏排查过程及解决

《java内存泄漏排查过程及解决》公司某服务内存持续增长,疑似内存泄漏,未触发OOM,排查方法包括检查JVM配置、分析GC执行状态、导出堆内存快照并用IDEAProfiler工具定位大对象及代码... 目录内存泄漏内存问题排查1.查看JVM内存配置2.分析gc是否正常执行3.导出 dump 各种工具分析4.

Linux之platform平台设备驱动详解

《Linux之platform平台设备驱动详解》Linux设备驱动模型中,Platform总线作为虚拟总线统一管理无物理总线依赖的嵌入式设备,通过platform_driver和platform_de... 目录platform驱动注册platform设备注册设备树Platform驱动和设备的关系总结在 l

Windows环境下解决Matplotlib中文字体显示问题的详细教程

《Windows环境下解决Matplotlib中文字体显示问题的详细教程》本文详细介绍了在Windows下解决Matplotlib中文显示问题的方法,包括安装字体、更新缓存、配置文件设置及编码調整,并... 目录引言问题分析解决方案详解1. 检查系统已安装字体2. 手动添加中文字体(以SimHei为例)步骤

Linux进程CPU绑定优化与实践过程

《Linux进程CPU绑定优化与实践过程》Linux支持进程绑定至特定CPU核心,通过sched_setaffinity系统调用和taskset工具实现,优化缓存效率与上下文切换,提升多核计算性能,适... 目录1. 多核处理器及并行计算概念1.1 多核处理器架构概述1.2 并行计算的含义及重要性1.3 并