diff options
| author | Siddhartha Agrawal <agrawals@codeaurora.org> | 2014-03-20 16:18:09 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:28:22 -0700 |
| commit | 1244fc88fc3318e2922fbde377979bb4ac218abe (patch) | |
| tree | 2a2367f7af063dde00c866d062f6b95410d78497 /drivers/video/fbdev | |
| parent | b6951a84267a33d64685c11ab22abdb8e69deb0b (diff) | |
msm: mdss: Correctly calculate DSI clocks if fbc is enabled
In cases where frame-buffer compression(fbc) is enabled, the
compressed ratio for xres isn't considered. Add logic to correctly
account for fbc when needed.
Change-Id: I0eec90cbbe0a0ffaea94cf1c2d6231e6545403b6
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 2 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_ctl.c | 2 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_intf_video.c | 4 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_panel.h | 20 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/msm_mdss_io_8974.c | 2 |
5 files changed, 20 insertions, 10 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index 34054ee2a267..04ddd252034e 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -902,7 +902,7 @@ static int mdss_dsi_dfps_config(struct mdss_panel_data *pdata, int new_fps) vsync_period = mdss_panel_get_vtotal(&pdata->panel_info); hsync_period = - mdss_panel_get_htotal(&pdata->panel_info); + mdss_panel_get_htotal(&pdata->panel_info, true); current_dsi_v_total = MIPI_INP((ctrl_pdata->ctrl_base) + 0x2C); new_dsi_v_total = diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index 748647ae3dae..16ce3fbc4d10 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -333,7 +333,7 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe, v_total = mdss_panel_get_vtotal(pinfo); xres = pinfo->xres; is_fbc = pinfo->fbc.enabled; - h_total = mdss_panel_get_htotal(pinfo); + h_total = mdss_panel_get_htotal(pinfo, false); } else { v_total = mixer->height; xres = mixer->width; diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c index 00b8ab94d8c7..4c958f34e0e2 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c @@ -493,7 +493,7 @@ static int mdss_mdp_video_vfp_fps_update(struct mdss_mdp_ctl *ctl, int new_fps) } vsync_period = mdss_panel_get_vtotal(&pdata->panel_info); - hsync_period = mdss_panel_get_htotal(&pdata->panel_info); + hsync_period = mdss_panel_get_htotal(&pdata->panel_info, true); curr_fps = mdss_panel_get_framerate(&pdata->panel_info); if (curr_fps > new_fps) { @@ -555,7 +555,7 @@ static int mdss_mdp_video_config_fps(struct mdss_mdp_ctl *ctl, } vsync_period = mdss_panel_get_vtotal(&pdata->panel_info); - hsync_period = mdss_panel_get_htotal(&pdata->panel_info); + hsync_period = mdss_panel_get_htotal(&pdata->panel_info, true); if (pdata->panel_info.dfps_update != DFPS_SUSPEND_RESUME_MODE) { diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h index 823bc94f443f..af681e32765b 100644 --- a/drivers/video/fbdev/msm/mdss_panel.h +++ b/drivers/video/fbdev/msm/mdss_panel.h @@ -421,15 +421,25 @@ static inline int mdss_panel_get_vtotal(struct mdss_panel_info *pinfo) /* * mdss_panel_get_htotal() - return panel horizontal width * @pinfo: Pointer to panel info containing all panel information + * @consider_fbc: true to factor fbc settings, false to ignore. * * Returns the total width of the panel including any blanking regions - * which are not visible to user but used for calculations. + * which are not visible to user but used for calculations. For certain + * usescases where the fbc parameters need to be ignored like bandwidth + * calculation, the appropriate flag can be passed. */ -static inline int mdss_panel_get_htotal(struct mdss_panel_info *pinfo) +static inline int mdss_panel_get_htotal(struct mdss_panel_info *pinfo, bool + consider_fbc) { - return pinfo->xres + pinfo->lcdc.h_back_porch + - pinfo->lcdc.h_front_porch + - pinfo->lcdc.h_pulse_width; + int adj_xres = pinfo->xres; + + if (consider_fbc && pinfo->fbc.enabled) + adj_xres = mult_frac(pinfo->xres, + pinfo->fbc.target_bpp, pinfo->bpp); + + return adj_xres + pinfo->lcdc.h_back_porch + + pinfo->lcdc.h_front_porch + + pinfo->lcdc.h_pulse_width; } int mdss_register_panel(struct platform_device *pdev, diff --git a/drivers/video/fbdev/msm/msm_mdss_io_8974.c b/drivers/video/fbdev/msm/msm_mdss_io_8974.c index 023937fa1051..d66c757a145d 100644 --- a/drivers/video/fbdev/msm/msm_mdss_io_8974.c +++ b/drivers/video/fbdev/msm/msm_mdss_io_8974.c @@ -163,7 +163,7 @@ int mdss_dsi_clk_div_config(struct mdss_panel_info *panel_info, break; } - h_period = mdss_panel_get_htotal(panel_info); + h_period = mdss_panel_get_htotal(panel_info, true); v_period = mdss_panel_get_vtotal(panel_info); if ((frame_rate != |
