mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm_fb: display: extend mutex protection for mdp pan display
When mdp commits a buffer to play, functions inside pan display, e.g. mdp4_overlay_mdp_perf_upd are based on the current state of play, so extending mutex to the scope of pan display to avoid race conditions. Change-Id: I2e55567fd21de3738be066a2dee298d8122f12a3 Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org> Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
This commit is contained in:
parent
5a0a4dcebf
commit
f72ca836e3
4 changed files with 16 additions and 13 deletions
|
@ -1209,11 +1209,8 @@ void mdp4_dsi_cmd_overlay(struct msm_fb_data_type *mfd)
|
|||
}
|
||||
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 1);
|
||||
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
mdp4_dsi_cmd_pipe_commit(cndx, 0);
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 0);
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
|
||||
}
|
||||
|
|
|
@ -1125,11 +1125,15 @@ void mdp4_dsi_video_overlay(struct msm_fb_data_type *mfd)
|
|||
struct vsycn_ctrl *vctrl;
|
||||
struct mdp4_overlay_pipe *pipe;
|
||||
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
|
||||
vctrl = &vsync_ctrl_db[cndx];
|
||||
pipe = vctrl->base_pipe;
|
||||
|
||||
if (!pipe || !mfd->panel_power_on)
|
||||
if (!pipe || !mfd->panel_power_on) {
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
pr_debug("%s: cpu=%d pid=%d\n", __func__,
|
||||
smp_processor_id(), current->pid);
|
||||
|
@ -1147,10 +1151,7 @@ void mdp4_dsi_video_overlay(struct msm_fb_data_type *mfd)
|
|||
}
|
||||
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 1);
|
||||
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
mdp4_dsi_video_pipe_commit(0, 0);
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
|
||||
if (pipe->ov_blt_addr)
|
||||
mdp4_dsi_video_wait4ov(0);
|
||||
|
|
|
@ -1052,8 +1052,11 @@ void mdp4_dtv_overlay(struct msm_fb_data_type *mfd)
|
|||
struct vsycn_ctrl *vctrl;
|
||||
struct mdp4_overlay_pipe *pipe;
|
||||
|
||||
if (!mfd->panel_power_on)
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
if (!mfd->panel_power_on) {
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
vctrl = &vsync_ctrl_db[cndx];
|
||||
if (vctrl->base_pipe == NULL)
|
||||
|
@ -1063,6 +1066,7 @@ void mdp4_dtv_overlay(struct msm_fb_data_type *mfd)
|
|||
|
||||
if (pipe == NULL) {
|
||||
pr_warn("%s: dtv_pipe == NULL\n", __func__);
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1078,7 +1082,6 @@ void mdp4_dtv_overlay(struct msm_fb_data_type *mfd)
|
|||
mdp4_dtv_pipe_queue(0, pipe);
|
||||
}
|
||||
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 1);
|
||||
mdp4_dtv_pipe_commit(0, 0);
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 0);
|
||||
|
|
|
@ -961,12 +961,15 @@ void mdp4_lcdc_overlay(struct msm_fb_data_type *mfd)
|
|||
struct vsycn_ctrl *vctrl;
|
||||
struct mdp4_overlay_pipe *pipe;
|
||||
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
|
||||
vctrl = &vsync_ctrl_db[cndx];
|
||||
pipe = vctrl->base_pipe;
|
||||
|
||||
if (!pipe || !mfd->panel_power_on)
|
||||
if (!pipe || !mfd->panel_power_on) {
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
pr_debug("%s: cpu=%d pid=%d\n", __func__,
|
||||
smp_processor_id(), current->pid);
|
||||
|
@ -985,9 +988,7 @@ void mdp4_lcdc_overlay(struct msm_fb_data_type *mfd)
|
|||
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 1);
|
||||
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
mdp4_lcdc_pipe_commit(0, 0);
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
|
||||
if (pipe->ov_blt_addr)
|
||||
mdp4_lcdc_wait4ov(0);
|
||||
|
@ -995,4 +996,5 @@ void mdp4_lcdc_overlay(struct msm_fb_data_type *mfd)
|
|||
mdp4_lcdc_wait4dmap(0);
|
||||
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 0);
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue