From 9a1da8b4c3f7eda09f6a2ef3f605d98aab52a36b Mon Sep 17 00:00:00 2001 From: Prabhanjan Kandula Date: Fri, 31 Dec 2021 18:28:50 +0530 Subject: [PATCH] disp: msm: fix rsc static wakeup time calculation Currently RSC timer register programming is optimized for updating only during timing param changes and not during RSC state changes with same timing. Static wakeup time computation should consider panel jitter for RSC clk state too, else it can result in RSC hang. This change also removes extra logic for video mode prefil lines computation for rsc config as video mode does not enable RSC solver. Current issue scenario exposing the hang is in dual dsi display scenario where RSC is in clock state and static wakeup time is programmed by not considering panel jitter, after suspend/pmsuspend while waking up if RSC switches to command state if primary enabled first and vsync may arrive much early based on the panel jitter. RSC hw can not handle if TE arrives earlier than static wakeup time causing RSC hang. Change-Id: I1434fdd71eb04fdbe22b3601500493c818e9126d Signed-off-by: Prabhanjan Kandula Signed-off-by: Jayaprakash Madisetty --- msm/sde/sde_encoder.c | 13 +------------ msm/sde_rsc.c | 6 +----- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index 2f4ccf9ae938..190e2a473384 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -1376,20 +1376,9 @@ static int _sde_encoder_update_rsc_client( (rsc_config->prefill_lines != mode_info->prefill_lines) || (rsc_config->jitter_numer != mode_info->jitter_numer) || (rsc_config->jitter_denom != mode_info->jitter_denom)) { - rsc_config->fps = mode_info->frame_rate; rsc_config->vtotal = mode_info->vtotal; - /* - * for video mode, prefill lines should not go beyond vertical - * front porch for RSCC configuration. This will ensure bw - * downvotes are not sent within the active region. Additional - * -1 is to give one line time for rscc mode min_threshold. - */ - if (is_vid_mode && (mode_info->prefill_lines >= v_front_porch)) - rsc_config->prefill_lines = v_front_porch - 1; - else - rsc_config->prefill_lines = mode_info->prefill_lines; - + rsc_config->prefill_lines = mode_info->prefill_lines; rsc_config->jitter_numer = mode_info->jitter_numer; rsc_config->jitter_denom = mode_info->jitter_denom; sde_enc->rsc_state_init = false; diff --git a/msm/sde_rsc.c b/msm/sde_rsc.c index 4b4c13bca0a5..14d180568115 100644 --- a/msm/sde_rsc.c +++ b/msm/sde_rsc.c @@ -331,11 +331,7 @@ static u32 sde_rsc_timer_calculate(struct sde_rsc_priv *rsc, line_time_ns = div_u64(line_time_ns, rsc->cmd_config.vtotal); prefill_time_ns = line_time_ns * rsc->cmd_config.prefill_lines; - /* only take jitter into account for CMD mode */ - if (state == SDE_RSC_CMD_STATE) - total = frame_time_ns - frame_jitter - prefill_time_ns; - else - total = frame_time_ns - prefill_time_ns; + total = frame_time_ns - frame_jitter - prefill_time_ns; if (total < 0) { pr_err("invalid total time period time:%llu jiter_time:%llu blanking time:%llu\n",