/*
- * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
int mdss_mdp_ctl_stop(struct mdss_mdp_ctl *ctl, int panel_power_mode);
int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg,
u32 flags);
-int mdss_mdp_get_prefetch_lines(struct mdss_panel_info *pinfo);
+int mdss_mdp_get_prefetch_lines(struct mdss_panel_info *pinfo, bool is_fixed);
int mdss_mdp_perf_bw_check(struct mdss_mdp_ctl *ctl,
struct mdss_mdp_pipe **left_plist, int left_cnt,
struct mdss_mdp_pipe **right_plist, int right_cnt);
* the mdp fetch lines as the last (25 - vbp - vpw) lines of vertical
* front porch.
*/
-int mdss_mdp_get_prefetch_lines(struct mdss_panel_info *pinfo)
+int mdss_mdp_get_prefetch_lines(struct mdss_panel_info *pinfo, bool is_fixed)
{
int prefetch_avail = 0;
int v_total, vfp_start;
if (!is_mdp_prefetch_needed(pinfo))
return 0;
- v_total = mdss_panel_get_vtotal(pinfo);
+ if (is_fixed)
+ v_total = mdss_panel_get_vtotal_fixed(pinfo);
+ else
+ v_total = mdss_panel_get_vtotal(pinfo);
+
vfp_start = (pinfo->lcdc.v_back_porch + pinfo->lcdc.v_pulse_width +
pinfo->yres);
struct mdss_mdp_video_ctx *ctx = ctl->intf_ctx[MASTER_CTX];
struct mdss_mdp_vsync_handler *tmp;
ktime_t vsync_time;
+ u32 ctl_flush_bits = 0;
if (!ctx) {
pr_err("invalid ctx\n");
vsync_time = ktime_get();
ctl->vsync_cnt++;
- MDSS_XLOG(ctl->num, ctl->vsync_cnt, ctl->vsync_cnt);
+ ctl_flush_bits = mdss_mdp_ctl_read(ctl, MDSS_MDP_REG_CTL_FLUSH);
- pr_debug("intr ctl=%d vsync cnt=%u vsync_time=%d\n",
- ctl->num, ctl->vsync_cnt, (int)ktime_to_ms(vsync_time));
+ MDSS_XLOG(ctl->num, ctl->vsync_cnt, ctl_flush_bits);
+
+ pr_debug("intr ctl=%d vsync cnt=%u vsync_time=%d ctl_flush=%d\n",
+ ctl->num, ctl->vsync_cnt, (int)ktime_to_ms(vsync_time),
+ ctl_flush_bits);
ctx->polling_en = false;
complete_all(&ctx->vsync_comp);
mdata = ctl->mdata;
+ pinfo->prg_fet = mdss_mdp_get_prefetch_lines(pinfo, true);
if (!pinfo->prg_fet) {
pr_debug("programmable fetch is not needed/supported\n");
* Fetch should always be outside the active lines. If the fetching
* is programmed within active region, hardware behavior is unknown.
*/
- v_total = mdss_panel_get_vtotal(pinfo);
+ v_total = mdss_panel_get_vtotal_fixed(pinfo);
h_total = mdss_panel_get_htotal(pinfo, true);
fetch_start = (v_total - pinfo->prg_fet) * h_total + 1;
ctx->intf_num);
return -EINVAL;
}
-
- pinfo->prg_fet = mdss_mdp_get_prefetch_lines(pinfo);
mdss_mdp_fetch_start_config(ctx, ctl);
if (test_bit(MDSS_QOS_VBLANK_PANIC_CTRL, mdata->mdss_qos_map))
{
if (!pdata->panel_info.default_fps) {
- pdata->panel_info.default_prg_fet =
- mdss_mdp_get_prefetch_lines(&pdata->panel_info);
-
/*
* This value will change dynamically once the
* actual dfps update happen in hw.
dfps_update_fps(&pdata->panel_info, new_fps);
- /*
- * Fetch start is pinned to default fps.
- * Adjust programmable fetch accordingly.
- */
pdata->panel_info.prg_fet =
- (pdata->panel_info.default_prg_fet) ?
- (pdata->panel_info.default_prg_fet + add_v_lines) : 0;
+ mdss_mdp_get_prefetch_lines(&pdata->panel_info, false);
} else if (pdata->panel_info.dfps_update ==
DFPS_IMMEDIATE_PORCH_UPDATE_MODE_HFP) {
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2016, 2018 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
pinfo->yres = pt->yres;
pinfo->lcdc.v_front_porch = pt->v_front_porch;
+ pinfo->lcdc.v_front_porch_fixed = pt->v_front_porch;
pinfo->lcdc.v_back_porch = pt->v_back_porch;
pinfo->lcdc.v_pulse_width = pt->v_pulse_width;
u32 h_active_low;
u32 v_back_porch;
u32 v_front_porch;
+ u32 v_front_porch_fixed;
u32 v_pulse_width;
u32 v_active_low;
u32 border_clr;
int new_fps;
/* stores initial fps after boot */
u32 default_fps;
- /* store programmable fetch corresponding to default fps */
- u32 default_prg_fet;
/* stores initial vtotal (vfp-method) or htotal (hfp-method) */
u32 saved_total;
/* stores initial vfp (vfp-method) or hfp (hfp-method) */
}
/*
+ * mdss_panel_get_vtotal_fixed() - return panel device tree vertical height
+ * @pinfo: Pointer to panel info containing all panel information
+ *
+ * Returns the total height as defined in panel device tree including any
+ * blanking regions which are not visible to user but used to calculate
+ * panel clock.
+ */
+static inline int mdss_panel_get_vtotal_fixed(struct mdss_panel_info *pinfo)
+{
+ return pinfo->yres + pinfo->lcdc.v_back_porch +
+ pinfo->lcdc.v_front_porch_fixed +
+ pinfo->lcdc.v_pulse_width+
+ pinfo->lcdc.border_top +
+ pinfo->lcdc.border_bottom;
+}
+
+/*
* mdss_panel_get_vtotal() - return panel vertical height
* @pinfo: Pointer to panel info containing all panel information
*