diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c index 396a007ba8cd..e4a3686076c8 100644 --- a/drivers/video/fbdev/msm/mdss_fb.c +++ b/drivers/video/fbdev/msm/mdss_fb.c @@ -280,7 +280,7 @@ static inline int mdss_fb_validate_split(int left, int right, u32 panel_xres = mfd->panel_info->xres; /* more validate condition could be added if needed */ if (left && right) { - if (mfd->split_display) + if (is_panel_split(mfd)) panel_xres *= 2; if (panel_xres == left + right) { @@ -289,7 +289,7 @@ static inline int mdss_fb_validate_split(int left, int right, rc = 0; } } else { - if (mfd->split_display) { + if (is_panel_split(mfd)) { mfd->split_fb_left = mfd->split_fb_right = panel_xres; rc = 0; } else { @@ -615,8 +615,9 @@ static int mdss_fb_probe(struct platform_device *pdev) mfd->fb_imgType = MDP_RGBA_8888; mfd->pdev = pdev; + mfd->split_mode = MDP_SPLIT_MODE_NONE; if (pdata->next) - mfd->split_display = true; + mfd->split_mode = MDP_SPLIT_MODE_LM; mfd->mdp = *mdp_instance; INIT_LIST_HEAD(&mfd->proc_list); @@ -1596,7 +1597,7 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd) } var->xres = panel_info->xres; - if (mfd->split_display) + if (is_panel_split(mfd)) var->xres *= 2; fix->type = panel_info->is_3d_panel; diff --git a/drivers/video/fbdev/msm/mdss_fb.h b/drivers/video/fbdev/msm/mdss_fb.h index f09cfc31a065..990a8a83717f 100644 --- a/drivers/video/fbdev/msm/mdss_fb.h +++ b/drivers/video/fbdev/msm/mdss_fb.h @@ -71,6 +71,20 @@ enum mdp_notify_event { MDP_NOTIFY_FRAME_TIMEOUT, }; +/** + * enum mdp_split_mode - Lists the possible split modes in the device + * + * @MDP_SPLIT_MODE_NONE: Not a Dual display, no panel split. + * @MDP_SPLIT_MODE_LM: Dual Display is true, Split across layer mixers + * @MDP_SPLIT_MODE_DST: Dual Display is true, Split is in the Destination + * i.e ping pong split. + */ +enum mdp_split_mode { + MDP_SPLIT_MODE_NONE, + MDP_SPLIT_MODE_LM, + MDP_SPLIT_MODE_DST, +}; + struct disp_info_type_suspend { int op_enable; int panel_power_on; @@ -167,7 +181,7 @@ struct msm_fb_data_type { struct panel_id panel; struct mdss_panel_info *panel_info; - int split_display; + int split_mode; int split_fb_left; int split_fb_right; @@ -261,6 +275,21 @@ static inline void mdss_fb_update_notify_update(struct msm_fb_data_type *mfd) } } +/* Function returns true for either Layer Mixer split or Ping pong split */ +static inline bool is_panel_split(struct msm_fb_data_type *mfd) +{ + return (mfd && (!(mfd->split_mode == MDP_SPLIT_MODE_NONE))); +} +/* Function returns true, if Layer Mixer split is Set*/ +static inline bool is_split_lm(struct msm_fb_data_type *mfd) +{ + return (mfd && (mfd->split_mode == MDP_SPLIT_MODE_LM)); +} +/* Function returns true, if Ping pong split is Set*/ +static inline bool is_split_dst(struct msm_fb_data_type *mfd) +{ + return (mfd && (mfd->split_mode == MDP_SPLIT_MODE_DST)); +} int mdss_fb_get_phys_info(dma_addr_t *start, unsigned long *len, int fb_num); void mdss_fb_set_backlight(struct msm_fb_data_type *mfd, u32 bkl_lvl); void mdss_fb_update_backlight(struct msm_fb_data_type *mfd); diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index ee2a2abf03ea..c37fe56661ce 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -1852,7 +1852,7 @@ static void mdss_mdp_overlay_pan_display(struct msm_fb_data_type *mfd) pipe->has_buf = 1; mdss_mdp_pipe_unmap(pipe); - if (fbi->var.xres > mdata->max_mixer_width || mfd->split_display) { + if (fbi->var.xres > mdata->max_mixer_width || is_split_lm(mfd)) { ret = mdss_mdp_overlay_get_fb_pipe(mfd, &pipe, MDSS_MDP_MIXER_MUX_RIGHT); if (ret) { @@ -3086,7 +3086,7 @@ static struct mdss_mdp_ctl *__mdss_mdp_overlay_ctl_init( INIT_WORK(&ctl->remove_underrun_handler, remove_underrun_vsync_handler); - if (mfd->split_display && pdata->next) { + if (is_split_lm(mfd)) { /* enable split display */ rc = mdss_mdp_ctl_split_display_setup(ctl, pdata->next); if (rc) { @@ -3331,7 +3331,7 @@ static int mdss_mdp_overlay_handoff(struct msm_fb_data_type *mfd) goto error; } - if (mfd->split_display) { + if (is_split_lm(mfd)) { sctl = mdss_mdp_get_split_ctl(ctl); if (!sctl) { pr_err("cannot get secondary ctl. fail the handoff\n"); @@ -3529,7 +3529,7 @@ int mdss_mdp_overlay_init(struct msm_fb_data_type *mfd) mfd->mdp.private1 = mdp5_data; mfd->wait_for_kickoff = true; - if (mfd->panel_info->partial_update_enabled && mfd->split_display) + if (mfd->panel_info->partial_update_enabled && is_split_lm(mfd)) mdp5_data->mdata->has_src_split = false; rc = mdss_mdp_overlay_fb_parse_dt(mfd); diff --git a/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c b/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c index 74a494abb0c2..dcc2f414ecfc 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c +++ b/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c @@ -334,8 +334,8 @@ static int mdss_mdp_splash_kickoff(struct msm_fb_data_type *mfd, * buffer boundry */ use_single_pipe = - !mfd->split_display || - (mfd->split_display && + !is_split_lm(mfd) || + (is_split_lm(mfd) && ((dest_rect->x + dest_rect->w) < mfd->split_fb_left || dest_rect->x > mfd->split_fb_left)) || (mdata->has_src_split &&