From 5bf05a730209db4b5342401b379d8b6ea04352ad Mon Sep 17 00:00:00 2001 From: Abhijit Kulkarni Date: Tue, 26 May 2020 10:39:52 -0700 Subject: [PATCH] disp: msm: sde: fix bandwidth voting in resume usecase This change resets the bandwidth vote after lastclose is called and all the custom properties are reset. This is required so that on next power commit when user space driver does not apply any bandwidth vote, driver applies correct vote. Additionally this change ensures that aggregate bandwidth vote never exceeds the max threshold. Change-Id: I95ca761b381709850b630ecd6647b45968a5041e Signed-off-by: Abhijit Kulkarni --- msm/sde/sde_core_perf.c | 2 ++ msm/sde/sde_crtc.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/msm/sde/sde_core_perf.c b/msm/sde/sde_core_perf.c index e686a07e485a..9d94ddedd25b 100644 --- a/msm/sde/sde_core_perf.c +++ b/msm/sde/sde_core_perf.c @@ -666,6 +666,8 @@ static void _sde_core_perf_crtc_update_bus(struct sde_kms *kms, } bus_ab_quota = max(bw_sum_of_intfs, kms->perf.perf_tune.min_bus_vote); + bus_ab_quota = min(bus_ab_quota, + kms->catalog->perf.max_bw_high*1000ULL); bus_ib_quota = perf.max_per_pipe_ib[bus_id]; if (kms->perf.perf_tune.mode == SDE_PERF_MODE_FIXED) { diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 0d2c27badcac..f144faa1690f 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -5573,6 +5573,9 @@ int sde_crtc_helper_reset_custom_properties(struct drm_crtc *crtc, } } + /* disable clk and bw control until clk & bw properties are set */ + cstate->bw_control = false; + cstate->bw_split_vote = false; return 0; }