summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2016-08-25 23:08:01 -0700
committerRamkumar Radhakrishnan <ramkumar@codeaurora.org>2016-08-26 16:56:36 -0700
commit4bb3edad43b9701710b180748f310fc96bcfe6a6 (patch)
treec0c0fb53fdcd9d43df7f1bbbcbfb9050ea90915a /drivers/video/fbdev
parente97b6a0e0217f7c072fdad6c50673cd7a64348e1 (diff)
msm: mdss: fix adaptive variable refresh and dynamic fps concurrency
Store the avr vtotal information computed from the initial timing information and use it to restore the register values to avoid flickering issues during suspend/resume usecase. CRs-Fixed: 1056610 Change-Id: I8c7d27a062b90a3f200904f0ba20fbdb0bb32d70 Signed-off-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_intf_video.c32
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.c1
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.h3
3 files changed, 22 insertions, 14 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
index 72fc20d97f44..781496c3915b 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
@@ -411,22 +411,28 @@ static void mdss_mdp_video_avr_vtotal_setup(struct mdss_mdp_ctl *ctl,
if (test_bit(MDSS_CAPS_AVR_SUPPORTED, mdata->mdss_caps_map)) {
struct mdss_panel_data *pdata = ctl->panel_data;
- u32 hsync_period = p->hsync_pulse_width + p->h_back_porch +
- p->width + p->h_front_porch;
- u32 vsync_period = p->vsync_pulse_width + p->v_back_porch +
- p->height + p->v_front_porch;
- u32 min_fps = pdata->panel_info.min_fps;
- u32 diff_fps = abs(pdata->panel_info.default_fps - min_fps);
- u32 vtotal = mdss_panel_get_vtotal(&pdata->panel_info);
-
- int add_porches = mult_frac(vtotal, diff_fps, min_fps);
-
- u32 vsync_period_slow = vsync_period + add_porches;
- u32 avr_vtotal = vsync_period_slow * hsync_period;
+ struct mdss_panel_info *pinfo = &pdata->panel_info;
+ u32 avr_vtotal = pinfo->saved_avr_vtotal;
+
+ if (!pinfo->saved_avr_vtotal) {
+ u32 hsync_period = p->hsync_pulse_width +
+ p->h_back_porch + p->width + p->h_front_porch;
+ u32 vsync_period = p->vsync_pulse_width +
+ p->v_back_porch + p->height + p->v_front_porch;
+ u32 min_fps = pinfo->min_fps;
+ u32 default_fps = mdss_panel_get_framerate(pinfo);
+ u32 diff_fps = abs(default_fps - min_fps);
+ u32 vtotal = mdss_panel_get_vtotal(pinfo);
+ int add_porches = mult_frac(vtotal, diff_fps, min_fps);
+ u32 vsync_period_slow = vsync_period + add_porches;
+
+ avr_vtotal = vsync_period_slow * hsync_period;
+ pinfo->saved_avr_vtotal = avr_vtotal;
+ }
mdp_video_write(ctx, MDSS_MDP_REG_INTF_AVR_VTOTAL, avr_vtotal);
- MDSS_XLOG(min_fps, vsync_period, vsync_period_slow, avr_vtotal);
+ MDSS_XLOG(pinfo->min_fps, pinfo->default_fps, avr_vtotal);
}
}
diff --git a/drivers/video/fbdev/msm/mdss_panel.c b/drivers/video/fbdev/msm/mdss_panel.c
index 61911810b2c0..97025b3a9c23 100644
--- a/drivers/video/fbdev/msm/mdss_panel.c
+++ b/drivers/video/fbdev/msm/mdss_panel.c
@@ -644,7 +644,6 @@ void mdss_panel_info_from_timing(struct mdss_panel_timing *pt,
pinfo->dsc_enc_total = pt->dsc_enc_total;
pinfo->fbc = pt->fbc;
pinfo->compression_mode = pt->compression_mode;
- pinfo->default_fps = pinfo->mipi.frame_rate;
pinfo->roi_alignment = pt->roi_alignment;
pinfo->te = pt->te;
diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h
index bde137269422..7656ebd8a2f7 100644
--- a/drivers/video/fbdev/msm/mdss_panel.h
+++ b/drivers/video/fbdev/msm/mdss_panel.h
@@ -722,6 +722,9 @@ struct mdss_panel_info {
/* debugfs structure for the panel */
struct mdss_panel_debugfs_info *debugfs_info;
+
+ /* stores initial adaptive variable refresh vtotal value */
+ u32 saved_avr_vtotal;
};
struct mdss_panel_timing {