From 99a7f030d4bc4efd3ee728736f217958bec00173 Mon Sep 17 00:00:00 2001 From: Lakshmi Narayana Kalavala Date: Mon, 8 Jul 2019 11:08:30 -0700 Subject: [PATCH] disp: msm: sde: fix the QOS setting mismatch Currently the display driver does not consider the write back client while deriving client type for QOS settings. Add new API to consider the write back and other non real time clients also for picking up the proper QOS settings. This patch also fixes the QOS setting mismatch with QSEEDLITE hardware. Change-Id: I5db3d21921b8930bb6399ea355d3ce2b60e51430 Signed-off-by: Lakshmi Narayana Kalavala --- msm/sde/sde_crtc.h | 18 ++++++++++++++++++ msm/sde/sde_plane.c | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/msm/sde/sde_crtc.h b/msm/sde/sde_crtc.h index ffeb42aa9f31..7190dc2f7898 100644 --- a/msm/sde/sde_crtc.h +++ b/msm/sde/sde_crtc.h @@ -619,6 +619,24 @@ static inline enum sde_crtc_client_type sde_crtc_get_client_type( return cstate->rsc_client ? RT_RSC_CLIENT : RT_CLIENT; } +/** + * sde_crtc_get_client_type_for_qos - check the crtc type- rt, nrt, rsc_rt, etc. + * @crtc: Pointer to crtc + */ +static inline enum sde_crtc_client_type sde_crtc_get_client_type_for_qos( + struct drm_crtc *crtc) +{ + struct sde_crtc_state *cstate = + crtc ? to_sde_crtc_state(crtc->state) : NULL; + + if (!cstate) + return NRT_CLIENT; + + return sde_crtc_get_intf_mode(crtc) == + INTF_MODE_WB_LINE ? NRT_CLIENT : + (cstate->rsc_client ? RT_RSC_CLIENT : RT_CLIENT); +} + /** * sde_crtc_is_enabled - check if sde crtc is enabled or not * @crtc: Pointer to crtc diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index d60a3ff7002e..f8747921ae22 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -376,7 +376,8 @@ static void _sde_plane_set_qos_lut(struct drm_plane *plane, if (fmt && SDE_FORMAT_IS_LINEAR(fmt)) lut_usage = SDE_QOS_LUT_USAGE_LINEAR; - else if (psde->features & BIT(SDE_SSPP_SCALER_QSEED3)) + else if (psde->features & BIT(SDE_SSPP_SCALER_QSEED3) || + psde->features & BIT(SDE_SSPP_SCALER_QSEED3LITE)) lut_usage = SDE_QOS_LUT_USAGE_MACROTILE_QSEED; else lut_usage = SDE_QOS_LUT_USAGE_MACROTILE; @@ -3194,7 +3195,8 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane, return 0; pstate->pending = true; - psde->is_rt_pipe = (sde_crtc_get_client_type(crtc) != NRT_CLIENT); + psde->is_rt_pipe = + (sde_crtc_get_client_type_for_qos(crtc) != NRT_CLIENT); _sde_plane_set_qos_ctrl(plane, false, SDE_PLANE_QOS_PANIC_CTRL); _sde_plane_update_properties(plane, crtc, fb);