This article was reproduced from: http://blog.csdn.net/dearsq/article/details/55049182
platform:rk3399
Os:android 6.0
version:v2016.08
-
- Code flow
- Code explanation
- MIPI DSI Interface Information initialization
- FB Related information read
- Timing parameter Initialization
- MIPI DSI Controller Initialization
- LCDC Controller Registration
This article is divided into two parts.
[RK3399] Two-screen display code implementation process Analysis (i) for the analysis RK video part of the standard code (base on 2017.2.13 updated)
"[RK3399] Dual-screen display code implementation process Analysis (ii)" For the two-screen display of the code after the patch of the process analysis (EDP + MIPI)
Code flow
Refer to the 3288 display module loading process as summarized by Krisfei great God.
http://blog.csdn.net/kris_fei/article/details/52584903
The code flow for Krisfei induction is as follows:
- MIPI DSI Interface Information initialization
- FB Related information read
- Timing parameter Initialization
- MIPI DSI Controller Initialization
- LCDC Controller Registration
Code explanation
There's not much change in the code on RK3399 . The following is the standard process for the display section.
When the make Menuconfig is configured
Location:
| Device Drivers
| Graphics Support
| -Rockchip Misc Video Driver
| LCD Panel Select ([=y])
Drivers/video/rockchip/screen/kconfig
Choice includes general LCD panel and RK MIPI DSI LCD
Difference is
is not set < CONFIG_LCD_MIPI=y --- > CONFIG_LCD_GENERAL=y > # CONFIG_LCD_MIPI is not set
The driver files that correspond to each other are
Lcd_general.c
Lcd_mipi.c
In the current version (2017.2.13), LCD_GENERAL.C has not implemented the code yet.
So we start by analyzing the default LCD_MIPI.C.
MIPI DSI Interface Information initialization
LCD_MIPI.C
Rk_mipi_screen_init
--platform_driver_probe-//name is Rk_mipi_screen
———— Rk_mipi_screen_probe
—————— Rk_mipi_screen_init_dt
——————//Read MIPI information (including screen_init), Dsi_lane,dsi_hs_clk,mipi_dsi_num, Power, RST, GPIO, screen timing information (including Sceen on Cmds, cmd_ Type, Cmd_delay, Cmd_debug)
FB Related information read
Rk_fb_init-RK_FB.C
--platform_driver_register,//name: "ROCKCHIP,RK-FB"
———— rk_fb_probe//Get Disp-mode, u-boot-logo-on and other parameters.
—————— rockchip_ion_client_create//create ion client.
/* ion, like Pmem, manages one or more memory pools, some of which are pre-allocated at boot time for special hardware use (GPU, display controller, etc.). It manages these pool through ion heaps. It can be shared between a userspace process or a module in the kernel. */
timing Initialization of parameters
The timing parameters of the LCD,LCD of the interface type are to be read.
Rk_screen_init-RK_SCREEN.C
--platform_driver_register,//name: "Rk-screen"
———— Rk_screen_probe
—————— Rk_fb_prase_timing_dt-RK_FB.C//read configuration exists in struct Rk_screen variable
———————— of_get_display_timing//Get timing parameters, multiple groups can be configured in DTS, which is read in loops.
———————— display_timings_get//Select which set of timing parameters are currently used according to the current Native-mode.
———————— rk_fb_video_mode_from_timing//Convert the timing to FB video mode for later use.
MIPI DSI Controller Initialization
If it is a different interface, then the corresponding interface controller driver is called to initialize.
Rk32_mipi_dsi_init-RK32_MIPI_DSI.C
--platform_driver_register,//name: "Rk32-mipi"
———— Rk32_mipi_dsi_probe//Initialize the struct DSI structure, including clock, DSi OPS, Rk_screen pass over parameters,
—————— Rk_fb_get_prmry_screen, RK_SCREEN.C//Gets the Rk_screen variable initialized in the previous rk_screen_probe ().
————————//rk_mipi_dsi_probe//This is not in the 3399 code
———————— Register_dsi_ops//dsi->ops to Dsi_ops
————————//dsi_probe_current_chip//Detect if DSI chip exists, this is not in the 3399 code
———————— rk_fb_trsm_ops_register//registered Trsm_mipi_ops for Trsm_dsi_ops
3288 of the rk_mipi_dsi_probe in this place were deleted in 3399.
Directly in the Rk_fb_get_prmry_screen Register_dsi_ops, also omitted dsi_probe_current_chip
LCDC Controller Registration
Rk3368_lcdc_module_init-RK3368_LCDC.C
--platform_driver_register-//.name = "RK3368-LCDC",
———— Rk3368_lcdc_probe
—————— of_property_read_u32 (NP, "Rockchip,prop", &prop);
——————//Judging if the screen is primary or extend, if extend will postpone register
—————— RK3368_LCDC_PARSE_DT//Read parameters of the LCDC controller
—————— Dev_drv->ops = &lcdc_drv_ops; LCDC corresponding Ops
—————— DEVM_REQUEST_IRQ//LCDC corresponding IRQ is RK3368_LCDC_ISR ()
—————— Rk_fb_register//OPS is Lcdc_drv_ops
———————— Rk_fb->lcdc_dev_drv[i] = dev_drv; According to Rk30_max_lcdc_support, the two groups of Lcdc_dev_drv are registered by cyclic
———————— init_lcdc_device_driver//Initialize Lcdc_device_driver
—————————— Init_lcdc_win//A LCDC can support 4 layers of win.
—————————— RK_DISP_PWR_CTR_PARSE_DT//Resolve LCDC power CTRL related content.
—————————— Rk_fb_set_prmry_screen
—————————— rk_fb_trsm_ops_get//Select the appropriate OPS based on the different screen types.
———————— Framebuffer_alloc//system to create the corresponding number of FB based on how much win
———————— Fb_videomode_to_var//convert Fb_videomode to Fb_var_screeninfo
———————— Dsp_mode = = One_vop_dual_mipi_ver_scan
————————//To determine the double screen with the same display of the refresh mode, if it is vertical refresh
————————//Set fbi->var.xres/= 2;fbi->var.yres= 2; fbi->var.xres_virtual/= 2; fbi->var.yres_virtual= 2;
———————— Fbi->fbops = &fb_ops; FB Ops
———————— RKFB_CREATE_SYSFS//Generate to/dev/graphics/fbx/
———————— Register_framebuffer
———————— Rkfb_create_sysfs
————————//The following code runs only once
———————— kthread_run//Create Rk_fb_wait_for_vsync_thread
———————— dev_drv->ops->post_dspbuf//show logo for primary display device
[Android6.0] [RK3399] Two-screen different display code implementation process analysis (a) "Turn"