msm8953 LCD 流程(休眠 / 唤醒)

一、 LK进recovey阶段:

涉及相关文件:

fbdev/core/fbmem.c

fbdev/msm/mdss_fb.c

drivers/video/fbdev/msm/mdss_dsi.c

drivers/video/fbdev/msm/mdss_dsi_panel.c

drivers/leds/led-class.c

流程:主要是通过dev/fb节点的ioctl方法来实现控制:开启显示线程,复位、初始化、打开背光等操作。

fb_ioctl->do_fb_ioctl->Fb_blank->info->fbops->fb_blank=mdss_fb_blank ->

mdss_fb_blank->mdss_fb_blank_sub -> 

进入recovery/ota升级时的流程:

亮屏:
mdss_fb_blank_unblank
	->mdss_fb_start_disp_thread
	->mfd->mdp.on_fnc(mfd)=mdss_mdp_overlay_on
		->__mdss_mdp_overlay_ctl_init
		->mdss_mdp_ctl_intf_event(mdp5_data->ctl, MDSS_EVENT_RESET, NULL, false)
			->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
		->mdss_mdp_overlay_start
			->mdss_mdp_clk_ctrl
			->mdss_mdp_ctl_start
				->mdss_dsi_event_handler(MDSS_EVENT_REGISTER_RECOVERY_HANDLER)
				->mdss_mdp_hist_intr_setup
		->mdss_mdp_overlay_kickoff
			->mdss_mdp_display_commit
				->ctl->ops.display_fnc=mdss_mdp_video_display
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
							->mdss_dsi_on
								->mdss_dsi_panel_power_ctrl
									->mdss_dsi_panel_power_on
										->mdss_dsi_pinctrl_set_state
										->mdss_dsi_panel_reset
								->mdss_dsi_phy_init
									->mdss_dsi_phy_init_sub
								->mdss_dsi_pinctrl_set_state
								->mdss_dsi_panel_reset
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_UNBLANK, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
							->mdss_dsi_unblank
								->mdss_dsi_clk_ctrl
								->ctrl_pdata->on=mdss_dsi_panel_on
									->mdss_bdg_video_on
										->bdg_data->ops.video_on
									->mdss_dsi_panel_cmds_send
									->mdss_dsi_panel_on_hdmi
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_POST_PANEL_ON, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
		->mdss_mdp_ctl_setup
	->mdss_fb_set_backlight
		->mdss_fb_scale_bl
		->pdata->set_backlight(pdata, temp)=mdss_dsi_panel_bl_ctrl
            ->mdss_dsi_panel_bklt_pwm

主要是涉及关闭显示线程,下发off指令,释放硬件资源,关闭背光等。

灭屏:
mdss_fb_blank_blank
	->mdss_fb_stop_disp_thread
	->mdss_fb_set_backlight
		->(*mfd->mdp.ad_calc_bl)(mfd, temp, &temp, &ad_bl_notify_needed) = pp_ad_calc_bl
		->mdss_fb_scale_bl
		->pdata->set_backlight(pdata, temp)=mdss_dsi_panel_bl_ctrl  //背光控制
	->mfd->mdp.off_fnc(mfd)=mdss_mdp_overlay_off
		->mdss_mdp_overlay_kickoff
			->mdss_mdp_overlay_start
				->mdss_mdp_ctl_start
					->mdss_mdp_hist_intr_setup(&mdata->hist_intr, MDSS_IRQ_RESUME)
				->mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF)
			->mdss_mdp_display_commit
				->ctl->ops.display_fnc(ctl, arg)=mdss_mdp_video_display
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler=mdss_dsi_event_handler
							->mdss_dsi_on
								->mdss_dsi_panel_power_ctrl(pdata, MDSS_PANEL_POWER_ON)
								->mdss_dsi_set_clk_src
								->mdss_dsi_pinctrl_set_state
								->mdss_dsi_panel_reset
							->mdss_dsi_op_mode_config
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_UNBLANK, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler=mdss_dsi_event_handler
							->mdss_dsi_unblank
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler=mdss_dsi_event_handler
							->mdss_dsi_unblank
					->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_POST_PANEL_ON, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->pdata->event_handler=mdss_dsi_event_handler
							->mdss_dsi_post_panel_on
		->mdss_mdp_ctl_stop
			->ctl->ops.stop_fnc(ctl, power_state)=mdss_mdp_video_ctx_stop
				->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
					->pdata->event_handler(pdata, event, arg) =mdss_dsi_event_handler
						->mdss_dsi_blank
							->ctrl_pdata->off(pdata)=mdss_dsi_panel_off
								->mdss_bdg_video_on
									->bdg_data->ops.video_on(on)=lt8911exb_video_on //桥接ic
								->mdss_dsi_panel_cmds_send
								->mdss_dsi_panel_off_hdmi
				->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_OFF, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
					->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
						->mdss_dsi_blank
						->mdss_dsi_off
							->mdss_dsi_controller_cfg
							->mdss_dsi_phy_disable
							->mdss_dsi_panel_power_ctrl
								->mdss_dsi_panel_power_off
									->mdss_dsi_panel_reset
			->mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_TOP, 0)
			->mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
                ->mdss_mdp_ctl_destroy

二、kernel部分LCD唤醒休眠流程

主要是开启显示线程,复位,、硬件初始化、控制背光等操作。

唤醒:
fb_ioctl
	->do_fb_ioctl
		->fb_blank
			->mdss_fb_blank
				->mdss_fb_blank_sub
					->mdss_fb_blank_unblank
						->mdss_fb_start_disp_thread
						->mfd->mdp.on_fnc=mdss_mdp_overlay_on
							->mdss_mdp_ctl_intf_event(mdp5_data->ctl, MDSS_EVENT_RESET, NULL, false)
							->mdss_mdp_overlay_start
								->mdss_mdp_ctl_start
									->mdss_mdp_ctl_start_sub
									->mdss_mdp_hist_intr_setup
									->mdss_mdp_ctl_split_display_enable
									->mdss_mdp_hist_intr_setup
								->mdss_mdp_ctl_notifier_register
								->mdss_mdp_pp_resume
								->mdss_mdp_splash_cleanup
							->mdss_mdp_overlay_kickoff
								->mdss_mdp_display_commit
									->ctl->ops.display_fnc(ctl, arg)=mdss_mdp_video_display
										->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
											->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
												->mdss_dsi_on
													->mdss_dsi_panel_power_ctrl
														->mdss_dsi_panel_power_on
															->mdss_dsi_pinctrl_set_state
															->mdss_dsi_panel_reset
													->mdss_dsi_clk_ctrl
													->mdss_dsi_phy_init
													->mdss_dsi_pinctrl_set_state
													->mdss_dsi_panel_reset
										->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_UNBLANK, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
											->mdss_dsi_unblank
												->ctrl_pdata->on(pdata)=mdss_dsi_panel_on
													->mdss_bdg_video_on
										->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
										->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_POST_PANEL_ON, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
						->mdss_fb_set_backlight
							->pdata->set_backlight(pdata, temp)=mdss_dsi_panel_bl_ctrl
                                ->mdss_dsi_panel_bklt_pwm

主要是先通过lcd-backlight节点的brightness_set方法关闭背光,再通过dev/fb节点的ioctl方法来停止显示线程,释放硬件资源。

休眠:
brightness_set=mdss_fb_set_bl_brightness
	->mdss_fb_set_backlight
		->pdata->set_backlight(pdata, temp)=mdss_dsi_panel_bl_ctrl
			->mdss_dsi_panel_bklt_pwm
fb_ioctl
	->do_fb_ioctl
		->fb_blank
			->mdss_fb_blank
				->mdss_fb_blank_sub
					->mdss_fb_blank_blank
						->mdss_fb_stop_disp_thread
						->mdss_fb_set_backlight
							->pdata->set_backlight(pdata, temp)=mdss_dsi_panel_bl_ctrl
						->mfd->mdp.off_fnc=mdss_mdp_overlay_off
							->mdss_mdp_ctl_stop
								->mdss_mdp_hist_intr_setup
								->ctl->ops.stop_fnc(ctl, power_state)=mdss_mdp_video_ctx_stop
									->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
										->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
											->mdss_dsi_blank
												->ctrl_pdata->off(pdata)
													->mdss_dsi_panel_off
														->mdss_bdg_video_on
														->mdss_dsi_panel_cmds_send
														->mdss_dsi_panel_off_hdmi
									->mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_OFF, NULL, CTL_INTF_EVENT_FLAG_DEFAULT)
										->pdata->event_handler(pdata, event, arg)=mdss_dsi_event_handler
											->mdss_dsi_off
												->mdss_dsi_clk_ctrl
												->mdss_dsi_controller_cfg
												->mdss_dsi_phy_disable
												->mdss_dsi_panel_power_ctrl
													->mdss_dsi_panel_power_off
														->mdss_dsi_panel_reset
														->mdss_dsi_pinctrl_set_state
								->mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_TOP, 0)
                                ->mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF)

三、LCD lk阶段的流程

主要是通过桥接ic和panel id来决定初始化的panelstruct面板的数据,再对实际面板的进行初始化流程。

涉及的文件:

Target/msm8953/oem_panel.c

Dev/gcdb/display/gcdb_display.c

Target/msm8953/target_display.c

Platform/msm_shared/display.c

Platform/msm_shared/mipi_dsi.c

LK部分LCD流程
target_display_init
	->gcdb_display_init
		->target_panel_enable
		->oem_panel_select
			->init_panel_data
				->set_panel_cmd_string("sec:dsi_hbs_sc7705_800p_dsi1_video")
		->dsi_panel_init
		->msm_display_init
			->pdata->power_func(1, &(panel->panel_info))=mdss_dsi_panel_power
			->pdata->dfps_func(&(panel->panel_info))=mdss_dsi_mipi_dfps_config
			->pdata->clk_func(1, &(panel->panel_info))
			->pdata->update_panel_info()
			->pdata->pll_clk_func(1, &(panel->panel_info))
			->msm_fb_alloc
			->display_image_on_screen
			->msm_display_config
				->mdss_dsi_config
					->mdss_dsi_phy_init
					->mdss_dsi_host_init
					->panel->pre_init_func
					->mdss_dsi_panel_initialize
						->get_panel_rdid
					->pinfo->rotate()
				->pinfo->early_config((void *)pinfo)
				->mdp_dsi_video_config
			->msm_display_on
				->mdp_dsi_video_on
				->mdss_dsi_post_on
				->mipi_dsi_on
			->pdata->post_power_func(1)
		->panel.bl_func=mdss_dsi_bl_enable
            ->panel_backlight_ctrl

你可能感兴趣的:(LCD,android,android,LCD,qcom,msm8953)