Merge "msm: mdss: fix to handle multi-rect configuration in error cases"
This commit is contained in:
commit
6392d4ee36
2 changed files with 50 additions and 12 deletions
|
@ -1453,6 +1453,21 @@ static void mdss_mdp_overlay_update_pm(struct mdss_overlay_private *mdp5_data)
|
|||
activate_event_timer(mdp5_data->cpu_pm_hdl, wakeup_time);
|
||||
}
|
||||
|
||||
static void __unstage_pipe_and_clean_buf(struct msm_fb_data_type *mfd,
|
||||
struct mdss_mdp_pipe *pipe, struct mdss_mdp_data *buf)
|
||||
{
|
||||
|
||||
pr_debug("unstaging pipe:%d rect:%d buf:%d\n",
|
||||
pipe->num, pipe->multirect.num, !buf);
|
||||
MDSS_XLOG(pipe->num, pipe->multirect.num, !buf);
|
||||
mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_left);
|
||||
mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_right);
|
||||
pipe->dirty = true;
|
||||
|
||||
if (buf)
|
||||
__pipe_buf_mark_cleanup(mfd, buf);
|
||||
}
|
||||
|
||||
static int __overlay_queue_pipes(struct msm_fb_data_type *mfd)
|
||||
{
|
||||
struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd);
|
||||
|
@ -1573,14 +1588,36 @@ static int __overlay_queue_pipes(struct msm_fb_data_type *mfd)
|
|||
ret = mdss_mdp_pipe_queue_data(pipe, buf);
|
||||
|
||||
if (IS_ERR_VALUE(ret)) {
|
||||
pr_warn("Unable to queue data for pnum=%d\n",
|
||||
pipe->num);
|
||||
mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_left);
|
||||
mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_right);
|
||||
pipe->dirty = true;
|
||||
pr_warn("Unable to queue data for pnum=%d rect=%d\n",
|
||||
pipe->num, pipe->multirect.num);
|
||||
|
||||
if (buf)
|
||||
__pipe_buf_mark_cleanup(mfd, buf);
|
||||
/*
|
||||
* If we fail for a multi-rect pipe, unstage both rects
|
||||
* so we don't leave the pipe configured in multi-rect
|
||||
* mode with only one rectangle staged.
|
||||
*/
|
||||
if (pipe->multirect.mode !=
|
||||
MDSS_MDP_PIPE_MULTIRECT_NONE) {
|
||||
struct mdss_mdp_pipe *next_pipe =
|
||||
(struct mdss_mdp_pipe *)
|
||||
pipe->multirect.next;
|
||||
|
||||
if (next_pipe) {
|
||||
struct mdss_mdp_data *next_buf =
|
||||
list_first_entry_or_null(
|
||||
&next_pipe->buf_queue,
|
||||
struct mdss_mdp_data,
|
||||
pipe_list);
|
||||
|
||||
__unstage_pipe_and_clean_buf(mfd,
|
||||
next_pipe, next_buf);
|
||||
} else {
|
||||
pr_warn("cannot find rect pnum=%d\n",
|
||||
pipe->num);
|
||||
}
|
||||
}
|
||||
|
||||
__unstage_pipe_and_clean_buf(mfd, pipe, buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2702,8 +2702,8 @@ int mdss_mdp_pipe_queue_data(struct mdss_mdp_pipe *pipe,
|
|||
if (ret) {
|
||||
pr_err("pipe pp setup error for pnum=%d\n", pipe->num);
|
||||
|
||||
MDSS_XLOG(pipe->num, pipe->mixer_left->num,
|
||||
pipe->play_cnt, 0xbad);
|
||||
MDSS_XLOG(pipe->num, pipe->multirect.num,
|
||||
pipe->mixer_left->num, pipe->play_cnt, 0xbad);
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
@ -2714,13 +2714,14 @@ int mdss_mdp_pipe_queue_data(struct mdss_mdp_pipe *pipe,
|
|||
pipe->params_changed = 0;
|
||||
mdss_mdp_pipe_solidfill_setup(pipe);
|
||||
|
||||
MDSS_XLOG(pipe->num, pipe->mixer_left->num, pipe->play_cnt,
|
||||
0x111);
|
||||
MDSS_XLOG(pipe->num, pipe->multirect.num, pipe->mixer_left->num,
|
||||
pipe->play_cnt, 0x111);
|
||||
|
||||
goto update_nobuf;
|
||||
}
|
||||
|
||||
MDSS_XLOG(pipe->num, pipe->mixer_left->num, pipe->play_cnt, 0x222);
|
||||
MDSS_XLOG(pipe->num, pipe->multirect.num, pipe->mixer_left->num,
|
||||
pipe->play_cnt, 0x222);
|
||||
|
||||
if (params_changed) {
|
||||
pipe->params_changed = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue