From fb4edab2b3651012855d41414a753ec049a17661 Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Fri, 14 Aug 2020 16:38:59 +0800 Subject: [PATCH] disp: msm: sde: Update UIDLE and QoS LUT when DRM mode is changed UIDLE and QoS LUT configurationis might be different between different frame rates. Add this change to update UIDLE and QoS LUT according to frame rate when DRM mode is changed. Change-Id: Ia16a963e185b911b7dd11e81a26cab732c2b185c Signed-off-by: Lei Chen --- msm/sde/sde_crtc.c | 10 ++++++++++ msm/sde/sde_plane.c | 8 +------- msm/sde/sde_plane.h | 9 +++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 275d169035..fee7645950 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -3209,6 +3209,7 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_encoder *encoder; struct drm_device *dev; struct sde_kms *sde_kms; + struct drm_plane *plane; struct sde_splash_display *splash_display; bool cont_splash_enabled = false, apply_cp_prop = false; size_t i; @@ -3268,6 +3269,15 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc, _sde_crtc_blend_setup(crtc, old_state, true); _sde_crtc_dest_scaler_setup(crtc); + if (old_state->mode_changed) { + sde_core_perf_crtc_update_uidle(crtc, true); + drm_atomic_crtc_for_each_plane(plane, crtc) { + if (plane->state && plane->state->fb) + _sde_plane_set_qos_lut(plane, crtc, + plane->state->fb); + } + } + /* * Since CP properties use AXI buffer to program the * HW, check if context bank is in attached state, diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index eca0b67e41..0c667d00f4 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -254,13 +254,7 @@ void sde_plane_set_sid(struct drm_plane *plane, u32 vm) sde_hw_set_sspp_sid(sde_kms->hw_sid, psde->pipe, vm); } -/** - * _sde_plane_set_qos_lut - set danger, safe and creq LUT of the given plane - * @plane: Pointer to drm plane - * @crtc: Pointer to drm crtc to find refresh rate on mode - * @fb: Pointer to framebuffer associated with the given plane - */ -static void _sde_plane_set_qos_lut(struct drm_plane *plane, +void _sde_plane_set_qos_lut(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb) { diff --git a/msm/sde/sde_plane.h b/msm/sde/sde_plane.h index baff282d6a..70b4caff86 100644 --- a/msm/sde/sde_plane.h +++ b/msm/sde/sde_plane.h @@ -195,6 +195,15 @@ void sde_plane_ctl_flush(struct drm_plane *plane, struct sde_hw_ctl *ctl, */ void sde_plane_restore(struct drm_plane *plane); +/** + * _sde_plane_set_qos_lut - set danger, safe and creq LUT of the given plane + * @plane: Pointer to drm plane + * @crtc: Pointer to drm crtc to find refresh rate on mode + * @fb: Pointer to framebuffer associated with the given plane + */ +void _sde_plane_set_qos_lut(struct drm_plane *plane, + struct drm_crtc *crtc, + struct drm_framebuffer *fb); /** * sde_plane_flush - final plane operations before commit flush * @plane: Pointer to drm plane structure