msm: display: Fix composition issues when framework rebooted in suspend.

Currently, if framework is rebooted while in suspend mode, borderfill
is not unset due to which MDP composition can not be enabled. This patch
fixes the issue.

Change-Id: I8b671eccedebf2bb08724cf2d284d4ab27a71360
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>

Conflicts:
	drivers/video/msm/msm_fb.c

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
This commit is contained in:
Naseer Ahmed 2013-04-04 11:01:17 -04:00 committed by Iliyan Malchev
parent 74410ce2f0
commit 7630f0c711
7 changed files with 126 additions and 10 deletions

View file

@ -556,6 +556,7 @@ int mdp4_atv_on(struct platform_device *pdev);
int mdp4_atv_off(struct platform_device *pdev);
void mdp4_dsi_video_fxn_register(cmd_fxn_t fxn);
void mdp4_dsi_video_overlay(struct msm_fb_data_type *mfd);
void mdp4_overlay_free_base_pipe(struct msm_fb_data_type *mfd);
void mdp4_lcdc_vsync_ctrl(struct fb_info *info, int enable);
void mdp4_overlay0_done_dsi_video(int cndx);
void mdp4_overlay0_done_dsi_cmd(int cndx);
@ -694,6 +695,10 @@ void mdp4_dsi_cmd_overlay_blt(struct msm_fb_data_type *mfd,
void mdp4_dsi_video_overlay_blt(struct msm_fb_data_type *mfd,
struct msmfb_overlay_blt *req);
void mdp4_dsi_video_base_swap(int cndx, struct mdp4_overlay_pipe *pipe);
void mdp4_dsi_video_free_base_pipe(struct msm_fb_data_type *mfd);
void mdp4_dsi_cmd_free_base_pipe(struct msm_fb_data_type *mfd);
void mdp4_lcdc_free_base_pipe(struct msm_fb_data_type *mfd);
void mdp4_dtv_free_base_pipe(struct msm_fb_data_type *mfd);
#ifdef CONFIG_FB_MSM_MDP40
static inline void mdp3_dsi_cmd_dma_busy_wait(struct msm_fb_data_type *mfd)

View file

@ -118,6 +118,20 @@ struct mdp4_overlay_perf {
struct mdp4_overlay_perf perf_request;
struct mdp4_overlay_perf perf_current;
void mdp4_overlay_free_base_pipe(struct msm_fb_data_type *mfd)
{
if (!hdmi_prim_display && mfd->index == 0) {
if (ctrl->panel_mode & MDP4_PANEL_DSI_VIDEO)
mdp4_dsi_video_free_base_pipe(mfd);
else if (ctrl->panel_mode & MDP4_PANEL_DSI_CMD)
mdp4_dsi_cmd_free_base_pipe(mfd);
else if (ctrl->panel_mode & MDP4_PANEL_LCDC)
mdp4_lcdc_free_base_pipe(mfd);
} else if (hdmi_prim_display || mfd->index == 1) {
mdp4_dtv_free_base_pipe(mfd);
}
}
static struct ion_client *display_iclient;
static int mdp4_map_sec_resource(struct msm_fb_data_type *mfd)

View file

@ -806,6 +806,27 @@ void mdp4_mipi_vsync_enable(struct msm_fb_data_type *mfd,
mdp_clk_ctrl(0);
}
void mdp4_dsi_cmd_free_base_pipe(struct msm_fb_data_type *mfd)
{
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
vctrl = &vsync_ctrl_db[0];
pipe = vctrl->base_pipe;
if (pipe == NULL)
return ;
/* adb stop */
if (pipe->pipe_type == OVERLAY_TYPE_BF)
mdp4_overlay_borderfill_stage_down(pipe);
/* base pipe may change after borderfill_stage_down */
pipe = vctrl->base_pipe;
mdp4_mixer_stage_down(pipe, 1);
mdp4_overlay_pipe_free(pipe);
vctrl->base_pipe = NULL;
}
void mdp4_dsi_cmd_base_swap(int cndx, struct mdp4_overlay_pipe *pipe)
{
struct vsycn_ctrl *vctrl;

View file

@ -479,6 +479,27 @@ void mdp4_dsi_vsync_init(int cndx)
spin_lock_init(&vctrl->spin_lock);
}
void mdp4_dsi_video_free_base_pipe(struct msm_fb_data_type *mfd)
{
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
vctrl = &vsync_ctrl_db[0];
pipe = vctrl->base_pipe;
if (pipe == NULL)
return ;
/* adb stop */
if (pipe->pipe_type == OVERLAY_TYPE_BF)
mdp4_overlay_borderfill_stage_down(pipe);
/* base pipe may change after borderfill_stage_down */
pipe = vctrl->base_pipe;
mdp4_mixer_stage_down(pipe, 1);
mdp4_overlay_pipe_free(pipe);
vctrl->base_pipe = NULL;
}
void mdp4_dsi_video_base_swap(int cndx, struct mdp4_overlay_pipe *pipe)
{
struct vsycn_ctrl *vctrl;

View file

@ -114,6 +114,27 @@ static void vsync_irq_disable(int intr, int term)
pr_debug("%s: IRQ-dis done, term=%x\n", __func__, term);
}
void mdp4_dtv_free_base_pipe(struct msm_fb_data_type *mfd)
{
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
vctrl = &vsync_ctrl_db[0];
pipe = vctrl->base_pipe;
if (pipe == NULL)
return ;
if (hdmi_prim_display) {
/* adb stop */
if (pipe->pipe_type == OVERLAY_TYPE_BF)
mdp4_overlay_borderfill_stage_down(pipe);
/* pipe == rgb2 */
vctrl->base_pipe = NULL;
}
}
void mdp4_overlay_dtv_start(void)
{
if (!dtv_enabled) {

View file

@ -463,6 +463,27 @@ void mdp4_lcdc_vsync_init(int cndx)
spin_lock_init(&vctrl->spin_lock);
}
void mdp4_lcdc_free_base_pipe(struct msm_fb_data_type *mfd)
{
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
vctrl = &vsync_ctrl_db[0];
pipe = vctrl->base_pipe;
if (pipe == NULL)
return ;
/* adb stop */
if (pipe->pipe_type == OVERLAY_TYPE_BF)
mdp4_overlay_borderfill_stage_down(pipe);
/* base pipe may change after borderfill_stage_down */
pipe = vctrl->base_pipe;
mdp4_mixer_stage_down(pipe, 1);
mdp4_overlay_pipe_free(pipe);
vctrl->base_pipe = NULL;
}
void mdp4_lcdc_base_swap(int cndx, struct mdp4_overlay_pipe *pipe)
{
struct vsycn_ctrl *vctrl;

View file

@ -958,9 +958,6 @@ static int msm_fb_blank_sub(int blank_mode, struct fb_info *info,
struct msm_fb_panel_data *pdata = NULL;
int ret = 0;
if (!op_enable)
return -EPERM;
pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data;
if ((!pdata) || (!pdata->on) || (!pdata->off)) {
printk(KERN_ERR "msm_fb_blank_sub: no panel operation detected!\n");
@ -1116,8 +1113,15 @@ static int msm_fb_blank(int blank_mode, struct fb_info *info)
}
msm_fb_pan_idle(mfd);
if (mfd->op_enable == 0) {
if (blank_mode == FB_BLANK_UNBLANK)
if (blank_mode == FB_BLANK_UNBLANK) {
mfd->suspend.panel_power_on = TRUE;
/* if unblank is called when system is in suspend,
wait for the system to resume */
while (mfd->suspend.op_suspend) {
pr_debug("waiting for system to resume\n");
msleep(20);
}
}
else
mfd->suspend.panel_power_on = FALSE;
}
@ -1775,6 +1779,11 @@ static int msm_fb_open(struct fb_info *info, int user)
return 0;
}
static void msm_fb_free_base_pipe(struct msm_fb_data_type *mfd)
{
return mdp4_overlay_free_base_pipe(mfd);
}
static int msm_fb_release(struct fb_info *info, int user)
{
struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;
@ -1788,12 +1797,16 @@ static int msm_fb_release(struct fb_info *info, int user)
msm_fb_pan_idle(mfd);
mfd->ref_cnt--;
if ((!mfd->ref_cnt) && (mfd->op_enable)) {
if ((ret =
msm_fb_blank_sub(FB_BLANK_POWERDOWN, info,
mfd->op_enable)) != 0) {
printk(KERN_ERR "msm_fb_release: can't turn off display!\n");
return ret;
if (!mfd->ref_cnt) {
if (mfd->op_enable) {
ret = msm_fb_blank_sub(FB_BLANK_POWERDOWN, info,
mfd->op_enable);
if (ret != 0) {
printk(KERN_ERR "msm_fb_release: can't turn off display!\n");
return ret;
}
} else {
msm_fb_free_base_pipe(mfd);
}
}