mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: display: add sync point support in overlay commit
Wait for fence signaled before commit, signal previous fence after commit done. Same as pan display Signed-off-by: Ken Zhang <kenz@codeaurora.org> Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
This commit is contained in:
parent
7bf0610f43
commit
e0501cd8dd
3 changed files with 34 additions and 20 deletions
|
@ -3432,6 +3432,8 @@ int mdp4_overlay_commit(struct fb_info *info, int mixer)
|
|||
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 1);
|
||||
|
||||
msm_fb_wait_for_fence(mfd);
|
||||
|
||||
if (mixer == MDP4_MIXER0) {
|
||||
if (ctrl->panel_mode & MDP4_PANEL_DSI_CMD) {
|
||||
/* cndx = 0 */
|
||||
|
@ -3447,6 +3449,7 @@ int mdp4_overlay_commit(struct fb_info *info, int mixer)
|
|||
if (ctrl->panel_mode & MDP4_PANEL_DTV)
|
||||
mdp4_dtv_pipe_commit(0, 1);
|
||||
}
|
||||
msm_fb_signal_timeline(mfd);
|
||||
|
||||
mdp4_overlay_mdp_perf_upd(mfd, 0);
|
||||
|
||||
|
|
|
@ -1754,8 +1754,34 @@ static int msm_fb_release(struct fb_info *info, int user)
|
|||
return ret;
|
||||
}
|
||||
|
||||
DEFINE_SEMAPHORE(msm_fb_pan_sem);
|
||||
int msm_fb_wait_for_fence(struct msm_fb_data_type *mfd)
|
||||
{
|
||||
int i, ret = 0;
|
||||
/* buf sync */
|
||||
for (i = 0; i < mfd->acq_fen_cnt; i++) {
|
||||
ret = sync_fence_wait(mfd->acq_fen[i], WAIT_FENCE_TIMEOUT);
|
||||
sync_fence_put(mfd->acq_fen[i]);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: sync_fence_wait failed! ret = %x\n",
|
||||
__func__, ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mfd->acq_fen_cnt = 0;
|
||||
return ret;
|
||||
}
|
||||
int msm_fb_signal_timeline(struct msm_fb_data_type *mfd)
|
||||
{
|
||||
if (mfd->timeline) {
|
||||
sw_sync_timeline_inc(mfd->timeline, 1);
|
||||
mfd->timeline_value++;
|
||||
}
|
||||
mfd->last_rel_fence = mfd->cur_rel_fence;
|
||||
mfd->cur_rel_fence = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_SEMAPHORE(msm_fb_pan_sem);
|
||||
static int msm_fb_pan_display(struct fb_var_screeninfo *var,
|
||||
struct fb_info *info)
|
||||
{
|
||||
|
@ -1763,7 +1789,6 @@ static int msm_fb_pan_display(struct fb_var_screeninfo *var,
|
|||
struct mdp_dirty_region *dirtyPtr = NULL;
|
||||
struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;
|
||||
struct msm_fb_panel_data *pdata;
|
||||
int i, ret;
|
||||
|
||||
/*
|
||||
* If framebuffer is 2, io pen display is not allowed.
|
||||
|
@ -1835,17 +1860,7 @@ static int msm_fb_pan_display(struct fb_var_screeninfo *var,
|
|||
mutex_unlock(&msm_fb_notify_update_sem);
|
||||
|
||||
down(&msm_fb_pan_sem);
|
||||
/* buf sync */
|
||||
for (i = 0; i < mfd->acq_fen_cnt; i++) {
|
||||
ret = sync_fence_wait(mfd->acq_fen[i], WAIT_FENCE_TIMEOUT);
|
||||
sync_fence_put(mfd->acq_fen[i]);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: sync_fence_wait failed! ret = %x\n",
|
||||
__func__, ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mfd->acq_fen_cnt = 0;
|
||||
msm_fb_wait_for_fence(mfd);
|
||||
if (info->node == 0 && !(mfd->cont_splash_done)) { /* primary */
|
||||
mdp_set_dma_pan_info(info, NULL, TRUE);
|
||||
if (msm_fb_blank_sub(FB_BLANK_UNBLANK, info, mfd->op_enable)) {
|
||||
|
@ -1862,12 +1877,7 @@ static int msm_fb_pan_display(struct fb_var_screeninfo *var,
|
|||
mdp_set_dma_pan_info(info, dirtyPtr,
|
||||
(var->activate == FB_ACTIVATE_VBL));
|
||||
mdp_dma_pan_update(info);
|
||||
if (mfd->timeline) {
|
||||
sw_sync_timeline_inc(mfd->timeline, 1);
|
||||
mfd->timeline_value++;
|
||||
}
|
||||
mfd->last_rel_fence = mfd->cur_rel_fence;
|
||||
mfd->cur_rel_fence = 0;
|
||||
msm_fb_signal_timeline(mfd);
|
||||
up(&msm_fb_pan_sem);
|
||||
|
||||
if (unset_bl_level && !bl_updated) {
|
||||
|
|
|
@ -214,7 +214,8 @@ int msm_fb_writeback_stop(struct fb_info *info);
|
|||
int msm_fb_writeback_terminate(struct fb_info *info);
|
||||
int msm_fb_detect_client(const char *name);
|
||||
int calc_fb_offset(struct msm_fb_data_type *mfd, struct fb_info *fbi, int bpp);
|
||||
|
||||
int msm_fb_wait_for_fence(struct msm_fb_data_type *mfd);
|
||||
int msm_fb_signal_timeline(struct msm_fb_data_type *mfd);
|
||||
#ifdef CONFIG_FB_BACKLIGHT
|
||||
void msm_fb_config_backlight(struct msm_fb_data_type *mfd);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue