当前位置:网站首页>Qualcomm platform LCM summary
Qualcomm platform LCM summary
2022-06-22 07:29:00 【Neilo_ chen】
The following figures are the most recent examples of our own modules LCM Some conclusions of , At present, it is only partially completed , And the description is not particularly in place , It will be updated and modified in the future .
The first one is LCM Overall migration framework and component diagram . It introduces LCM The steps and key points of the driving segment and debugging screen .
branch lk and kernel Two parts , What exactly .c, How to add a new screen , General steps and methods .

The second figure is the initialization flow chart of the screen , It is divided into lk and kernel Two parts .Lk Part of it is as follows :
When the system is up, it will call bootable/bootloader/lk/app/aboot/aboot.c, In this function aboot_init() Function to call the display initialization function target_display_init(), Call... In this function gcdb_display_init().
One of the most important functions in this function is oem_panel_select(), It's defined in oem_panel.c in , It is based on Qualcomm's private code hw_id To decide which one you use LCD, And put panel Relevant data information is filled into the data structure --init_panel_data(),gcdb_display_init() After the execution of oem_panel_select() Be sure to use panel and panel After the relevant information , A series of values related to this are assigned through the function pointer panel Related functions , Include pll, Backlight ,clk, Initialization and enabling functions related to power supply , In order to call... Below .
meanwhile , Start execution A series of screen initialization processes . First step , Access to electricity , perform pdata->power_func, Open some ldo, Enable some system power , Pull it higher gpio, Make the screen powered , And do it on the screen inside reset, The function called is target_panel_reset(), In the face reset The pins are operated high and low . Then enable the clock , call pdata->clk_func, Then do some enabling pll, Distribute framebuffer, adopt fbcon_setup(&(panel->fb)) Function to set the global pointer such as the resolution and display address of the record display . Next into msm_display_config() Function for LVDS_PANEL,MIPI_VIDEO_PANEL,MIPI_CMD_PANEL Etc dsi and mipi To configure .
After some columns dsi Parameter set last call mdss_dsi_panel_initialize(), Use mdss_dsi_cmds_tx() towards lcm Of driver ic Sent initialization code . And decide , If target_panel_auto_detect_enabled() Open the conversation , Using the Qualcomm platform lcm read_id function mdss_dsi_read_panel_signature() Conduct id Read .
After completing this series of operations, execute msm_display_on(), Lighting screen , The last stage calls pdata->bl_func(1) Turn on the backlight . So the whole LK Of lcm Initialization is complete .LK The initialization flow chart of is as follows .

Next is kernel Stage LCM The initialization process .
kernel Stage , First, three platform devices will be registered in the driver ,msm_fb,mdp,mipi_dsi.mdp The module is Qualcomm's internal display control chip ,mipi_dsi It is a transport protocol layer device ,msm_fb It is the driving device of Qualcomm graphics card .
The first thing to execute is mdp Driven probe, Carry out hardware resources including clock , interrupt ,iommu, Bus ,DMA The initialization , Register some interfaces for fb Use of equipment .mdp Initialize after initialization dsi controller , stay mdss_dsi_ctrl_probe Function , A function was called mdss_ds_config_panel, In this function , Get by name matching panel Device node , If there is no match, call msm-mtp.dtsi Preset panel device node.
Next, execute the function dsi_panel_device_register() register panel_device Device node . In this register function , I'm sure it's DSI_VIDEO_MODE still MIPI_CMD_MODE, Obtained some resources such as gpio,regulatot,dsi-lane Relevant information , The important thing is that it registers a event_handler:mdss_dsi_event_handler, This event handler function will accept all kinds of... From other layers event Events include lighting , Turn off the screen, etc . Also through this event_handler,dsi Driver layer and fb layer ,mdp Layer to communicate .
And then execute mdss_dsi_panel_init Function panel The initialization . This function parses dtsi The file gets the name of the screen , The resolution of the , Physical dimensions ,dsi type ,porch Parameters , Color format , Initialization instruction , Backlight mode and other parameters , And fill them in one by one pinfo In this structure , And registered some on off , Set the backlight , Select operating functions such as mode . Next is mdss_fb Initialization of the device , stay mdss_fb_probe Function , By calling mfd->mdp.init_fnc To initialize mdp, adopt lcd_backlight_registered() To register the backlight driver .
When the system starts animation , Will call functions mdss_fb_open open fb controller , It's going to execute mdss_fb_blank_sub() And pass in FB_BLANK_UNBLANK event Parameters , perform mdss_fb_blank_unblank() function . In this function , By calling mfd->mdp.on_fnc() Yes mdp In drive on_fnc function , Namely mdp3_ctrl_on() function , This function moves forward dsi In drive event handler Send three events MDSS_EVENT_LINK_READY,MDSS_EVENT_UNBLANK,MDSS_EVENT_PANEL_ON call mdss_dsi_panel Driving medium mdss_dsi_on().
The configuration is executed inside dsi, Access to electricity ,reset, Send instructions to operate in a series to light up the screen . such kernel Part of the screen initialization is completed .
The picture below is KERNEL Initialization flow chart of the phase .

The fourth picture , It is the data transmission diagram of lighting screen and extinguishing screen from upper layer to bottom layer .
If you want to turn off the screen , The upper layer will call PowerManagerService Methods provided . The calling relationship of the whole process is goToSleep->goToSleepInternal-> updatePowerStateLocked->updateDisplayPowerStateLocked->
requestPowerState->sendUpdatePowerStateLocked->mHandler.sendMessage(msg)-> updatePowerState->animateScreenStateChange->setScreenState->scheduleScreenUpdate->
postScreenUpdateThreadSafe->mPhotonicModulator.setState->mLock.notifyAll-> mBlanker.requestDisplayState->initPowerManagement->callbacks.onDisplayStateChange->
setHalAutoSuspendModeLocked->nativeSetAutoSuspend
The last to nativeSetAutoSuspend() This local method , Is in
frameworks/base/services/jni/com_android_server_power_PowerManagerService.cpp
Called , Call the autosuspend_enable(), This function will go to /sys/power/state Node
mem.
This node , Is in kernel/kernel/power/main.c Created in sysfs The file nodes , Once a value is written into it, the corresponding store function . Off screen , The upper layer writes mem, Called store In the middle of suspend function , Then the system will go suspend technological process . Pass to the screen , stay msm_fb Call in system suspend function ,
After some column calls , Go to the mdss_fb_blank_blank(), call mfd->mdp.off_fnc, call mdp_ctrl.c
Of mdp_ctrl_off function , therefore panel->set_backlight(panel, 0) Turn off the backlight , By sending
MDSS_EVENT_BLANK to dsi In drive event_handler, call mdss_dsi_blank() Perform a series of operations to power off the screen . In this way, the whole screen extinguishing process is completed .
If the screen is on , Also from PowerManagerService Provide methods wake up, Finally call jni Of autosuspend_disable(), Go to /sys/power/state Node on, Last call suspend Process Lighting screen .
The flow chart is shown below .

Picture 5 , It summarizes how the backlight adjustment is transmitted from the upper layer to the bottom layer .
When the user is on the mobile phone setting-display-backlights When adjusting the backlight , The system will call
packages\apps\Settings\src\com\android\settings\BrightnessPreference.java To achieve . Set the brightness adjustment range here 0-255, adopt powermanagerservice.java The interface of setBrightness Implementation services . This method is defined in LightService.java in , call setBrightness()--->setLightLocked()--->setLight_native().
This local method is in frameworks\base\services\jni\com_android_server_LightsService.cpp achieve . Under this file ,init_native Function , call hw_get_module(LIGHTS_HARDWARE_MODULE_ID, (hw_module_t const**)&module) obtain lights Hardware abstraction layer module lights.default.so And load , call hall Layer function devices->lights[light]->set_light(devices->lights[light],&state) Set brightness .hall The code of the layer is hardware/qcom/display/liblight/lights.c.
In this, we have realized open_lights,close_lights,rgb_to_brightness Such as function . The key is , When adjusting the brightness , Will call the set_light_backlight(), adopt write_int Go to /sys/class/leds/lcd-backlight/brightness Write value . This file node is located in kernel Layer creation .kernel layer , stay Mdss_dsi_panel.c In the document , There is a backlight control function static void mdss_dsi_panel_bl_ctrl(struct mdss_panel_data *pdata,u32 bl_level), The parameter backlight value is through this bl_level For adjustment .
After one layer of call , In fact, kernel/drivers/leds/Led-class.c Created in the sysfs The file nodes /sys/class/leds/lcd-backlight/brightness, And in store Function , Save the current brightness value to led_cdev->brightness variable , Layer by layer to the drive bl_level. such , The transmission of backlight adjustment values from the upper layer to the bottom layer is formed .

The above pictures , In general, it summarizes LCM The driving part and some upper level relations , technological process . This sort of arrangement is quite helpful for your understanding and familiarity with the module . With the deepening of the work , I will continue to supplement and improve this document , Hope to achieve good results in practical work .
边栏推荐
- Up sampling and down sampling (notes, for personal use)
- MySQL面试真题(十九)——抖音-选出每个月有连续登录2天的用户名单
- Crmeb mall order shipping function
- How to cancel crmeb customer service link
- Backup the method of uploading babies in Taobao stores to multiple stores
- Protection of RT thread critical section
- ROS QT environment construction
- CONDA installation method of deepmd kit and the solution of slow speed
- Article editing test of CSDN
- Self attention (notes, for personal use)
猜你喜欢

Taobao store backup one store upload to multiple stores precautions

Canoe learning notes (1) illustration of new project and channel configuration steps

Color matching of architecture diagram

Crmeb mall order shipping function

js实现随机生成16位的密钥——基础积累

Multi camera data collection based on Kinect azure (II)

The width of each picture in the description of the mobile terminal baby should be between 480 and 1500, and the maximum height is 2500. The following pictures are not satisfied

Backup the method of uploading babies in Taobao stores to multiple stores

Crmeb open version 4.3

Open version - order delivery
随机推荐
What if the finder fails to respond continuously? Finder unresponsive solution tutorial
网站的日常维护
如何解决‘WebDriver‘ object has no attribute ‘switch_to_window‘
《百度搜索引擎网页质量白皮书》指导网站建设及优化
Notes on algebra 10.1: understanding of symmetric polynomials and derivation of cubic resolvents
phpcms手机门户网站配置
Antd - a-upload-dragger drag upload component - Basic accumulation
Open version - account information synchronization and unification
校招路上的坑
6、 Scrollview component
Crmeb open source version, a free mall worth trying
JS implementation of random generation of 16 bit key -- Basic accumulation
汇编学习《汇编语言(第三版)》王爽著第四章学习
Backup the method of uploading babies in Taobao stores to multiple stores
chrome浏览器查看cookie方法
Get through version 4.3 mind map
4、 Button component
微信小游戏(四)
Téléchargement de toutes les versions de chromedriver
微信小游戏(三)