From ebe8b1bace67efb739d707514b92353ec1c2f771 Mon Sep 17 00:00:00 2001 From: Veera Sundaram Sankaran Date: Mon, 20 Dec 2021 11:56:15 -0800 Subject: [PATCH] disp: msm: sde: add line-based QoS calculation support From kalama, add support for QoS fill level calculations based on line-based QoS calculations. Change-Id: I524ca29c6e9d1912b44a328a2a88d08341cccefc Signed-off-by: Veera Sundaram Sankaran --- msm/sde/sde_hw_catalog.c | 1 + msm/sde/sde_hw_catalog.h | 2 ++ msm/sde/sde_plane.c | 11 +++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/msm/sde/sde_hw_catalog.c b/msm/sde/sde_hw_catalog.c index 6d02c206..a887e370 100644 --- a/msm/sde/sde_hw_catalog.c +++ b/msm/sde/sde_hw_catalog.c @@ -5270,6 +5270,7 @@ static int _sde_hardware_pre_caps(struct sde_mdss_cfg *sde_cfg, uint32_t hw_rev) sde_cfg->autorefresh_disable_seq = AUTOREFRESH_DISABLE_SEQ2; sde_cfg->perf.min_prefill_lines = 40; sde_cfg->vbif_qos_nlvl = 8; + sde_cfg->qos_target_time_ns = 11160; sde_cfg->ts_prefill_rev = 2; sde_cfg->ctl_rev = SDE_CTL_CFG_VERSION_1_0_0; sde_cfg->true_inline_rot_rev = SDE_INLINE_ROT_VERSION_2_0_1; diff --git a/msm/sde/sde_hw_catalog.h b/msm/sde/sde_hw_catalog.h index 33697588..0a56ddd6 100644 --- a/msm/sde/sde_hw_catalog.h +++ b/msm/sde/sde_hw_catalog.h @@ -1795,6 +1795,7 @@ struct sde_perf_cfg { * @max_mixer_width max layer mixer line width * @max_mixer_blendstages max layer mixer blend stages (z orders) * @vbif_qos_nlvl number of vbif QoS priority levels + * @qos_target_time_ns normalized qos target time for line-based qos * @macrotile_mode UBWC parameter for macro tile channel distribution * @pipe_order_type indicates if it is required to specify pipe order * @csc_type csc or csc_10bit support @@ -1904,6 +1905,7 @@ struct sde_mdss_cfg { /* Configs */ u32 vbif_qos_nlvl; + u32 qos_target_time_ns; u32 macrotile_mode; u32 pipe_order_type; u32 csc_type; diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index 5ea16b49..e5acaa35 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -250,8 +250,10 @@ static void _sde_plane_set_qos_lut(struct drm_plane *plane, u32 frame_rate, qos_count, fps_index = 0, lut_index, creq_lut_index, ds_lut_index; struct sde_perf_cfg *perf; struct sde_plane_state *pstate; + struct sde_crtc *sde_crtc = to_sde_crtc(crtc); bool inline_rot = false, landscape = false; struct drm_display_mode *mode; + u32 fl_require0 = 0; if (!plane || !fb) { SDE_ERROR("invalid arguments\n"); @@ -305,8 +307,13 @@ static void _sde_plane_set_qos_lut(struct drm_plane *plane, psde->pipe_qos_cfg.creq_lut = perf->creq_lut[creq_lut_index]; ds_lut_index = lut_index * SDE_DANGER_SAFE_LUT_TYPE_MAX; - if (landscape) - ds_lut_index += SDE_DANGER_SAFE_LUT_TYPE_LANDSCAPE; + if (landscape) { + if (psde->catalog->qos_target_time_ns && sde_crtc->line_time_in_ns) + fl_require0 = psde->catalog->qos_target_time_ns / + (sde_crtc->line_time_in_ns * 2); + if (!fl_require0 || fl_require0 < 4.5) + ds_lut_index += SDE_DANGER_SAFE_LUT_TYPE_LANDSCAPE; + } ds_lut_index += (fps_index * SDE_QOS_LUT_USAGE_MAX * SDE_DANGER_SAFE_LUT_TYPE_MAX); psde->pipe_qos_cfg.danger_lut = perf->danger_lut[ds_lut_index]; psde->pipe_qos_cfg.safe_lut = perf->safe_lut[ds_lut_index];