From 0c2aa527bfdbcae97478b7e3760d0bf6adff3852 Mon Sep 17 00:00:00 2001 From: Gopikrishnaiah Anandan Date: Fri, 15 Jan 2021 10:11:23 -0800 Subject: [PATCH] disp: msm: sde: fix partial update offset calculation Panel height and width should be passed for partial update offset calculation. Change passes the offsets to demura partial update function. Change-Id: Ic4113d46e8c1643a855f672e7a2bdd848ef99adc --- msm/sde/sde_color_processing.c | 3 +++ msm/sde/sde_plane.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/msm/sde/sde_color_processing.c b/msm/sde/sde_color_processing.c index b1082da3..e38a5201 100644 --- a/msm/sde/sde_color_processing.c +++ b/msm/sde/sde_color_processing.c @@ -1990,6 +1990,8 @@ static int _sde_cp_crtc_update_pu_features(struct drm_crtc *crtc, bool *need_flu hw_cfg.payload = (sde_crtc_state->user_roi_list.num_rects) ? &sde_crtc_state->user_roi_list : NULL; hw_cfg.len = sizeof(sde_crtc_state->user_roi_list); + hw_cfg.panel_height = sde_crtc->base.state->adjusted_mode.vdisplay; + hw_cfg.panel_width = sde_crtc->base.state->adjusted_mode.hdisplay; for (i = 0; i < hw_cfg.num_of_mixers; i++) hw_cfg.dspp[i] = sde_crtc->mixers[i].hw_dspp; @@ -2634,6 +2636,7 @@ void sde_cp_disable_features(struct drm_crtc *crtc) ret = set_feature(hw_dspp, &hw_cfg, sde_crtc); if (ret) break; + _sde_cp_dspp_flush_helper(sde_crtc, SDE_CP_CRTC_DSPP_DEMURA_INIT); } mutex_unlock(&sde_crtc->crtc_cp_lock); } diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index f385dc33..85604ddc 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -3336,6 +3336,7 @@ static void _sde_plane_atomic_disable(struct drm_plane *plane, struct drm_plane_state *state; struct sde_plane_state *pstate; u32 multirect_index = SDE_SSPP_RECT_0; + u32 blend_type; if (!plane) { SDE_ERROR("invalid plane\n"); @@ -3352,6 +3353,14 @@ static void _sde_plane_atomic_disable(struct drm_plane *plane, state = plane->state; pstate = to_sde_plane_state(state); + blend_type = sde_plane_get_property(pstate, + PLANE_PROP_BLEND_OP); + /* some of the color features are dependent on plane with skip blend. + * if skip blend plane is being disabled, we need to disable color properties. + */ + if (blend_type == SDE_DRM_BLEND_OP_SKIP && old_state->crtc) + sde_crtc_disable_cp_features(old_state->crtc); + SDE_EVT32(DRMID(plane), is_sde_plane_virtual(plane), pstate->multirect_mode);