From e993215979958be9df138f3a9b2b2a9acc08405a Mon Sep 17 00:00:00 2001 From: Satya Rama Aditya Pinapala Date: Wed, 19 May 2021 15:10:29 -0700 Subject: [PATCH] disp: msm: dsi: update transfer time calculation during RSC disable If RSCC solver is disabled, the transfer time calculation can be skip using TE jitter. This case threshold time becomes prefill time + DCS command transfer threshold. The threshold for DCS command transfer is configured to 40us. Change-Id: I1260df33e9d928aacd8961bdedfcd136563a806b Signed-off-by: Satya Rama Aditya Pinapala --- msm/dsi/dsi_panel.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index bcc7a7990d..a4d7e2c10e 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -35,6 +35,8 @@ #define DEFAULT_PANEL_PREFILL_LINES 25 #define HIGH_REFRESH_RATE_THRESHOLD_TIME_US 500 #define MIN_PREFILL_LINES 40 +#define RSCC_MODE_THRESHOLD_TIME_US 40 +#define DCS_COMMAND_THRESHOLD_TIME_US 40 static void dsi_dce_prepare_pps_header(char *buf, u32 pps_delay_ms) { @@ -3961,11 +3963,22 @@ void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config, timing->min_dsi_clk_hz = min_bitclk_hz; - min_threshold_us = mult_frac(frame_time_us, - jitter_numer, (jitter_denom * 100)); + /* + * Apart from prefill line time, we need to take into account RSCC mode threshold time. In + * cases where RSC is disabled, as jitter is no longer considered we need to make sure we + * have enough time for DCS command transfer. As of now, the RSC threshold time and DCS + * threshold time are configured to 40us. + */ + if (mode->priv_info->disable_rsc_solver) { + min_threshold_us = DCS_COMMAND_THRESHOLD_TIME_US; + } else { + min_threshold_us = mult_frac(frame_time_us, jitter_numer, (jitter_denom * 100)); + min_threshold_us += RSCC_MODE_THRESHOLD_TIME_US; + } + /* * Increase the prefill_lines proportionately as recommended - * 35lines for 60fps, 52 for 90fps, 70lines for 120fps. + * 40lines for 60fps, 60 for 90fps, 120lines for 120fps, and so on. */ prefill_lines = mult_frac(MIN_PREFILL_LINES, timing->refresh_rate, 60); @@ -3973,11 +3986,7 @@ void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config, prefill_time_us = mult_frac(frame_time_us, prefill_lines, (timing->v_active)); - /* - * Threshold is sum of panel jitter time, prefill line time - * plus 64usec buffer time. - */ - min_threshold_us = min_threshold_us + 64 + prefill_time_us; + min_threshold_us = min_threshold_us + prefill_time_us; DSI_DEBUG("min threshold time=%d\n", min_threshold_us); @@ -3995,7 +4004,8 @@ void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config, timing->dsi_transfer_time_us = mode->priv_info->mdp_transfer_time_us; } else { - if (min_threshold_us > frame_threshold_us) + if ((min_threshold_us > frame_threshold_us) || + (mode->priv_info->disable_rsc_solver)) frame_threshold_us = min_threshold_us; timing->dsi_transfer_time_us = frame_time_us -