显示函数研究续
1、Display_Utils_Initialize初始化 Apps BootLoader (ABL) 接口,检查由 ABL 设置的面板覆盖(如果有)并设置将由 MDPInit 使用的参数。
void Display_Utils_Initialize(bool32 (*pSupportedDisplayList)[])
{
Display_UtilsContextType *pDisplayContext = GET_DISPLAY_CONTEXT();
/* initialize override flag */
MDP_OSAL_MEMZERO(pDisplayContext, sizeof(Display_UtilsContextType));
/* get list of supported panels & build DT info array */
CheckTargetPanelSupport();
/* Check panel override */
CheckPanelOverride(pSupportedDisplayList);
}
CheckTargetPanelSupport();这个函数主要获取开发者注册的panel list和PanelCount,并调用MDP_SetBootServiceVariable将这两个panel相关信息注册为全局变量。
CheckPanelOverride(pSupportedDisplayList); //检查是否有fastboot oem select-display-panel jdi_1080p_video 命令选择的面板,同时解析命令中的":cs1" ":cs0" 附加命令。
2、Display_Utils_CheckPanelSkip解释见注释,如果选中的面板被skip了,则选择软件渲染方式
* Check for panel override and if the overridden panel is supported in
* bootloader
* \retval TRUE if panel configuration is to be skipped in bootloader
3、SetupPlatformPanelConfig
这个函数大概的意思是判断 用于 强制填充(fastboot命令)的Panelid 是否储存于 已知的 Panel列表中(fastBootPanelList)。有则 使用这个参数,如果屏id is not override and it is not SW render- 选择默认面板进行加电并触发动态检测
4、MDPPLATFORM_CONFIG_POWERUP
对支持的平台类型进行上电:
- 针对主屏,使用屏对应的上电时序
- 针对拓展屏,使用默认的拓展屏上电策略
- 上下电函数定义为
- #define MDP_PLATFORM_PANEL_FUNCTION_ENTRY2(_panelselection_, _panelgpio_, _xmlconfig_)\
- {\
(_panelselection_),\
(_panelgpio_),\
(_xmlconfig_),\
Panel_Default_PowerUp,\
Panel_Default_PowerDown,\
Panel_Default_Reset,\
Panel_Default_Peripheral_Power,\
Panel_Default_Brightness_Enable,\
Panel_Default_Brightness_Level\
}
5、GetPmicIBBLABMode
这个函数用来判断
MDP_PMIC_MODULE_CONTROLTYPE_IBB_LAB_LCD
MDP_PMIC_MODULE_CONTROLTYPE_IBB_LAB_OLED
6、显示屏初始化 MDPInit()
分配 DSI 和 I2C 相关的缓存内存资源
检查是否配置了bSWRender 软件渲染,
如果没有配置,则获取平台信息,是硬件初始化
检查在ABL中是否有对屏幕配置覆盖,或者是否支持 硬件屏幕,判断条见为 gPanelList 数组内容是否为空
初始化 MDP HAL,配置 MMU
如果不支持硬件屏幕,或者屏幕检测失败,则配置为软件渲染
7、MDPPlatformConfigure(eDisplayId, MDPPLATFORM_CONFIG_GETPANELCONFIG, &sPlatformParams) 从flash读取xml配置文件
8、XML_Parser(sPlatformParams.sPlatformPanel.pPanelXMLConfig, sPlatformParams.sPlatformPanel.uConfigSize, sXmlTagsList, XML_TAGSLIST_LENGTH)解析上面函数读取到的xml
9、pPanelInfo->eSelectedPanel动态获取到的当前Panel
10、if( (0x00 == pDsiMapping[0]) && (0x01 == pDsiMapping[1]))判断当前是否为dual DSI panel
11、DisplayDxe_SetMode --> MDPSetMode --> MDPSetupPipe--> MDPPanelInit --> DSIDriver_SetMode --> send init sequence
12、gDxeModeInfo.hDispThread = ThreadCreate ("Disp", &SetModeThread, 0, UEFI_THREAD_PRIORITY + 1, DEFAULT_STACK_SIZE * 3) //创建SetModeThread
ThreadDetach (gDxeModeInfo.hDispThread);分离线程
ThreadResume (gDxeModeInfo.hDispThread);线程运行
13、DisplayDxe_SetMode 配置mdp a new source surface and/or cropping rectangle,执行复位屏,初始化屏,设置背光等功能。
14、DsiPanelInit 初始化DSI Clocks and timing initialization,复位屏()MDPPlatformConfigure(pPanelInfo->eDisplayId, MDPPLATFORM_CONFIG_RESETPANEL, &sMDPPlatformParam)
15、DSIDriver_SetMode根据xml里面的分辨率,porch dsc参数等初始化dsi core
16、MDPUpdateCoreClockAndBandwidth// Dynamically update core clock and bandwidth to meet requirement of fps > 60Hz
17、Display_Utils_SetPanelConfiguration(eDisplayId);// Update ABL with selected panel info
18、MDPSetProperty(eDisplayId, MDP_DISPLAY_PROPERTY_BACKLIGHT, &sDisplayProp);//调用MDPPlatformConfigure(eDisplayId, MDPPLATFORM_CONFIG_SETBACKLIGHT, &sPlatformParams)配置背光
19、MDPSetProperty(eDisplayId, MDP_DISPLAY_PROPERTY_FIRMWAREENV, NULL);// Populate the display environment information, used to inform the OS driver of firmware state.