msm: mdss: fix bandwidth vote release for dual-dsi cmd mode panels

For dual-dsi command mode panels, bandwidth(bw) vote is supposed to be
released once ping-pong done interrupt for both controller is received.
In current implementation, if secondary ctl finishes last, which is the
case most of the times, then bw release is called using secondary ctl.
But bw is calculated/stored using main ctl because of which bw vote is
never released as expected. Fix this by releasing bw vote using main ctl.

Change-Id: Iadbd150ed6a35478da2cb376e29b01e579a526b8
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
This commit is contained in:
Ujwal Patel 2014-07-10 18:52:47 -07:00 committed by David Keitel
parent 33fcbb988d
commit 7e9ccef551
2 changed files with 32 additions and 15 deletions

View file

@ -497,6 +497,14 @@ enum mdss_screen_state {
MDSS_SCREEN_FORCE_BLANK,
};
#define mfd_to_mdp5_data(mfd) (mfd->mdp.private1)
#define mfd_to_mdata(mfd) (((struct mdss_overlay_private *)\
(mfd->mdp.private1))->mdata)
#define mfd_to_ctl(mfd) (((struct mdss_overlay_private *)\
(mfd->mdp.private1))->ctl)
#define mfd_to_wb(mfd) (((struct mdss_overlay_private *)\
(mfd->mdp.private1))->wb)
static inline struct mdss_mdp_ctl *mdss_mdp_get_split_ctl(
struct mdss_mdp_ctl *ctl)
{
@ -506,6 +514,16 @@ static inline struct mdss_mdp_ctl *mdss_mdp_get_split_ctl(
return NULL;
}
static inline struct mdss_mdp_ctl *mdss_mdp_get_main_ctl(
struct mdss_mdp_ctl *sctl)
{
if (sctl && sctl->mfd && sctl->mixer_left &&
sctl->mixer_left->is_right_mixer)
return mfd_to_ctl(sctl->mfd);
return NULL;
}
static inline bool mdss_mdp_pipe_is_yuv(struct mdss_mdp_pipe *pipe)
{
return pipe && (pipe->type == MDSS_MDP_PIPE_TYPE_VIG);
@ -837,14 +855,5 @@ int mdss_mdp_wb_set_secure(struct msm_fb_data_type *mfd, int enable);
int mdss_mdp_wb_get_secure(struct msm_fb_data_type *mfd, uint8_t *enable);
void mdss_mdp_ctl_restore(struct mdss_mdp_ctl *ctl);
int mdss_mdp_footswitch_ctrl_idle_pc(int on, struct device *dev);
#define mfd_to_mdp5_data(mfd) (mfd->mdp.private1)
#define mfd_to_mdata(mfd) (((struct mdss_overlay_private *)\
(mfd->mdp.private1))->mdata)
#define mfd_to_ctl(mfd) (((struct mdss_overlay_private *)\
(mfd->mdp.private1))->ctl)
#define mfd_to_wb(mfd) (((struct mdss_overlay_private *)\
(mfd->mdp.private1))->wb)
int mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl);
#endif /* MDSS_MDP_H */

View file

@ -1027,9 +1027,9 @@ void mdss_mdp_ctl_perf_release_bw(struct mdss_mdp_ctl *ctl)
* released.
*/
for (i = 0; i < mdata->nctl; i++) {
struct mdss_mdp_ctl *ctl = mdata->ctl_off + i;
struct mdss_mdp_ctl *ctl_local = mdata->ctl_off + i;
if (ctl->power_on && ctl->is_video_mode)
if (ctl_local->power_on && ctl_local->is_video_mode)
goto exit;
}
@ -1038,10 +1038,18 @@ void mdss_mdp_ctl_perf_release_bw(struct mdss_mdp_ctl *ctl)
/*Release the bandwidth only if there are no transactions pending*/
if (!transaction_status) {
trace_mdp_cmd_release_bw(ctl->num);
ctl->cur_perf.bw_ctl = 0;
ctl->new_perf.bw_ctl = 0;
pr_debug("Release BW ctl=%d\n", ctl->num);
/*
* for splitdisplay if release_bw is called using secondary
* then find the main ctl and release BW for main ctl because
* BW is always calculated/stored using main ctl.
*/
struct mdss_mdp_ctl *ctl_local =
mdss_mdp_get_main_ctl(ctl) ? : ctl;
trace_mdp_cmd_release_bw(ctl_local->num);
ctl_local->cur_perf.bw_ctl = 0;
ctl_local->new_perf.bw_ctl = 0;
pr_debug("Release BW ctl=%d\n", ctl_local->num);
mdss_mdp_ctl_perf_update_bus(mdata, 0);
}
exit: