From 72f31fb34bc36ba669298a75e9f4a112ea80c1db Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 3 Mar 2021 18:57:11 +0530 Subject: [PATCH 1/3] disp: msm: dsi: update CPHY command mode clock calculation In CPHY, packet header and checksum is sent twice and SYNC is sent in between two headers. So, increase packet overhead used in clock calculation to 15 bytes. Packet Header: 8 bytes, CRC: 4 bytes, SYNC: 2 bytes and dcs command: 1 byte. Change-Id: I7a1160cbb57ba4f1faeb4b36a16c322e6069d58f Signed-off-by: Ritesh Kumar --- msm/dsi/dsi_panel.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index e5de6bfd2272..3830a7eb8aa4 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #include @@ -3874,13 +3874,18 @@ void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config, struct dsi_mode_info *timing = &mode->timing; struct dsi_display_mode *display_mode; u32 jitter_numer, jitter_denom, prefill_lines; - u32 min_threshold_us, prefill_time_us, max_transfer_us; + u32 min_threshold_us, prefill_time_us, max_transfer_us, packet_overhead; u16 bpp; - /* Packet overlead in bits,2 bytes header + 2 bytes checksum - * + 1 byte dcs data command. + /* Packet overhead in bits, + * DPHY: 4 bytes header + 2 bytes checksum + 1 byte dcs data command. + * CPHY: 8 bytes header + 4 bytes checksum + 2 bytes SYNC + + * 1 byte dcs data command. */ - const u32 packet_overhead = 56; + if (config->phy_type & DSI_PHY_TYPE_CPHY) + packet_overhead = 120; + else + packet_overhead = 56; display_mode = container_of(timing, struct dsi_display_mode, timing); From 473f90a236b7914e9731c3edeb45d4e70a803e73 Mon Sep 17 00:00:00 2001 From: Yashwanth Date: Mon, 8 Mar 2021 19:17:17 +0530 Subject: [PATCH 2/3] disp: msm: sde: remove static access specifier for sde_dbg_base In DLKM builds, all the display symbols are included as part of msm_drm.ko and symbols are dynamically linked while loading ramdumps. This change removes static specifier for sde_dbg_base in order to access the variable from ramparser and extract the required logs with the help of ramparser tool and also in automation stability runs. Change-Id: I3eae0bc9db3bd285642bf9f7930a31ab47c446e3 Signed-off-by: Yashwanth --- msm/sde_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msm/sde_dbg.c b/msm/sde_dbg.c index 73471906079c..eb85c0e37e7e 100644 --- a/msm/sde_dbg.c +++ b/msm/sde_dbg.c @@ -262,7 +262,7 @@ struct sde_dbg_regbuf { * @vbif_dbgbus_dump_idx: index for tracking vbif dumps in hw recovery * @hw_ownership: indicates if the VM owns the HW resources */ -static struct sde_dbg_base { +struct sde_dbg_base { struct sde_dbg_evtlog *evtlog; struct sde_dbg_reglog *reglog; struct list_head reg_base_list; From e603c2e5a0885328bbb6769ddb7984e6da2e0ce0 Mon Sep 17 00:00:00 2001 From: Yashwanth Date: Tue, 9 Mar 2021 14:31:39 +0530 Subject: [PATCH 3/3] disp: msm: sde: add ctl reset during wait for commit done timeout During one of the DP timeout usecases, flush doesn't take effect due to vid vblank wait failure. As a result, smmu faults are observed because of fetching the previously staged planes. This change adds ctl reset in the same DP atomic commit context to recover and avoid smmu faults. Change-Id: I2f9aceca56e27f140607317f7596d6fe0d908af8 Signed-off-by: Yashwanth --- msm/sde/sde_crtc.c | 12 ++---------- msm/sde/sde_crtc.h | 8 ++++++-- msm/sde/sde_kms.c | 29 +---------------------------- msm/sde/sde_kms.h | 11 ----------- 4 files changed, 9 insertions(+), 51 deletions(-) diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 8f07399cf402..580ab53007f5 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -3637,11 +3637,8 @@ int sde_crtc_reset_hw(struct drm_crtc *crtc, struct drm_crtc_state *old_state, } /* Early out if simple ctl reset succeeded */ - if (i == sde_crtc->num_ctls) { - sde_kms_update_recovery_mask(_sde_crtc_get_kms(crtc), - crtc, false); + if (i == sde_crtc->num_ctls) return 0; - } SDE_DEBUG("crtc%d: issuing hard reset\n", DRMID(crtc)); @@ -3699,8 +3696,6 @@ int sde_crtc_reset_hw(struct drm_crtc *crtc, struct drm_crtc_state *old_state, sde_encoder_kickoff(encoder, false, true); } - sde_kms_update_recovery_mask(_sde_crtc_get_kms(crtc), - crtc, false); /* panic the device if VBIF is not in good state */ return !recovery_events ? 0 : -EAGAIN; } @@ -3776,8 +3771,6 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc, params.recovery_events_enabled)) is_error = true; sde_crtc->needs_hw_reset = false; - } else { - sde_kms_update_recovery_mask(sde_kms, crtc, false); } sde_crtc_calc_fps(sde_crtc); @@ -3798,10 +3791,9 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc, sde_vbif_clear_errors(sde_kms); - if (is_error || sde_kms->recovery_mask) { + if (is_error) { _sde_crtc_remove_pipe_flush(crtc); _sde_crtc_blend_setup(crtc, old_state, false); - SDE_EVT32(sde_kms->recovery_mask); } list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { diff --git a/msm/sde/sde_crtc.h b/msm/sde/sde_crtc.h index d391c81a72ab..2248a59c5090 100644 --- a/msm/sde/sde_crtc.h +++ b/msm/sde/sde_crtc.h @@ -27,6 +27,7 @@ #include "sde_kms.h" #include "sde_core_perf.h" #include "sde_hw_ds.h" +#include "sde_encoder.h" #define SDE_CRTC_NAME_SIZE 12 @@ -575,12 +576,15 @@ int sde_crtc_reset_hw(struct drm_crtc *crtc, struct drm_crtc_state *old_state, /** * sde_crtc_request_frame_reset - requests for next frame reset * @crtc: Pointer to drm crtc object + * @encoder: Pointer to drm encoder object */ -static inline int sde_crtc_request_frame_reset(struct drm_crtc *crtc) +static inline int sde_crtc_request_frame_reset(struct drm_crtc *crtc, + struct drm_encoder *encoder) { struct sde_crtc *sde_crtc = to_sde_crtc(crtc); - if (sde_crtc->frame_trigger_mode == FRAME_DONE_WAIT_POSTED_START) + if (sde_crtc->frame_trigger_mode == FRAME_DONE_WAIT_POSTED_START || + !sde_encoder_is_dsi_display(encoder)) sde_crtc_reset_hw(crtc, crtc->state, false); return 0; diff --git a/msm/sde/sde_kms.c b/msm/sde/sde_kms.c index f3dfc261c374..e466c0fc02ca 100644 --- a/msm/sde/sde_kms.c +++ b/msm/sde/sde_kms.c @@ -1512,31 +1512,6 @@ static void sde_kms_complete_commit(struct msm_kms *kms, SDE_ATRACE_END("sde_kms_complete_commit"); } -void sde_kms_update_recovery_mask(struct sde_kms *sde_kms, - struct drm_crtc *crtc, bool flag) -{ - int i; - struct sde_hw_ctl *ctl; - struct sde_crtc *sde_crtc; - - if (!crtc || !sde_kms) { - SDE_ERROR("invalid params\n"); - return; - } - - sde_crtc = to_sde_crtc(crtc); - - for (i = 0; i < sde_crtc->num_ctls; ++i) { - ctl = sde_crtc->mixers[i].hw_ctl; - if (!ctl || !ctl->ops.reset) - continue; - if (flag) - sde_kms->recovery_mask |= BIT(ctl->idx - CTL_0); - else - sde_kms->recovery_mask &= ~BIT(ctl->idx - CTL_0); - } -} - static void sde_kms_wait_for_commit_done(struct msm_kms *kms, struct drm_crtc *crtc) { @@ -1586,9 +1561,7 @@ static void sde_kms_wait_for_commit_done(struct msm_kms *kms, ret = sde_encoder_wait_for_event(encoder, MSM_ENC_COMMIT_DONE); if (ret && ret != -EWOULDBLOCK) { SDE_ERROR("wait for commit done returned %d\n", ret); - sde_kms_update_recovery_mask(to_sde_kms(kms), - crtc, true); - sde_crtc_request_frame_reset(crtc); + sde_crtc_request_frame_reset(crtc, encoder); break; } diff --git a/msm/sde/sde_kms.h b/msm/sde/sde_kms.h index b6332f9c54b9..9306d76152d1 100644 --- a/msm/sde/sde_kms.h +++ b/msm/sde/sde_kms.h @@ -274,7 +274,6 @@ struct sde_kms { int irq_num; /* mdss irq number */ bool irq_enabled; - int recovery_mask; struct sde_core_perf perf; /* saved atomic state during system suspend */ @@ -755,14 +754,4 @@ int sde_kms_vm_trusted_prepare_commit(struct sde_kms *sde_kms, */ int sde_kms_vm_primary_prepare_commit(struct sde_kms *sde_kms, struct drm_atomic_state *state); - -/** - * sde_kms_update_recovery_mask - function to update recovery ctl mask - * during error cases - * @sde_kms: pointer to sde_kms - * @crtc: pointer to drm_crtc - * @flag: to determine whether to clear/set recovery mask - */ -void sde_kms_update_recovery_mask(struct sde_kms *sde_kms, - struct drm_crtc *crtc, bool flag); #endif /* __sde_kms_H__ */