From 1661be90860fd4ca924928f4c0578c3756df0b47 Mon Sep 17 00:00:00 2001 From: Xiaowen Wu Date: Mon, 23 Nov 2020 18:52:00 -0500 Subject: [PATCH] disp: msm: sde: add scaler3_cfg and pixel_ext to sde plane Add scaler3_cfg and pixel_ext to sde plane to avoid updating state variables in commit thread. This fixes atomic check failure when scaler lut is not set. Change-Id: I936b124ca6f90af22a87df31536204e837422a70 Signed-off-by: Xiaowen Wu Signed-off-by: Abhijit Kulkarni --- msm/sde/sde_plane.c | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index 20c1fb1d1441..02d00b6c97f4 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -123,6 +123,9 @@ struct sde_plane { struct sde_csc_cfg *csc_usr_ptr; struct sde_csc_cfg *csc_ptr; + struct sde_hw_scaler3_cfg scaler3_cfg; + struct sde_hw_pixel_ext pixel_ext; + const struct sde_sspp_sub_blks *pipe_sblk; char pipe_name[SDE_NAME_SIZE]; @@ -297,11 +300,11 @@ void _sde_plane_set_qos_lut(struct drm_plane *plane, fb->modifier); if (fmt && SDE_FORMAT_IS_LINEAR(fmt) && - pstate->scaler3_cfg.enable) + psde->scaler3_cfg.enable) lut_index = SDE_QOS_LUT_USAGE_LINEAR_QSEED; else if (fmt && SDE_FORMAT_IS_LINEAR(fmt)) lut_index = SDE_QOS_LUT_USAGE_LINEAR; - else if (pstate->scaler3_cfg.enable) + else if (psde->scaler3_cfg.enable) lut_index = SDE_QOS_LUT_USAGE_MACROTILE_QSEED; else lut_index = SDE_QOS_LUT_USAGE_MACROTILE; @@ -794,7 +797,7 @@ static int _sde_plane_setup_scaler3_lut(struct sde_plane *psde, return -EINVAL; } - cfg = &pstate->scaler3_cfg; + cfg = &psde->scaler3_cfg; cfg->dir_lut = msm_property_get_blob( &psde->property_info, @@ -818,7 +821,7 @@ static int _sde_plane_setup_scaler3lite_lut(struct sde_plane *psde, { struct sde_hw_scaler3_cfg *cfg; - cfg = &pstate->scaler3_cfg; + cfg = &psde->scaler3_cfg; cfg->sep_lut = msm_property_get_blob( &psde->property_info, @@ -843,14 +846,14 @@ static void _sde_plane_setup_scaler3(struct sde_plane *psde, return; } - scale_cfg = &pstate->scaler3_cfg; + scale_cfg = &psde->scaler3_cfg; src_w = psde->pipe_cfg.src_rect.w; src_h = psde->pipe_cfg.src_rect.h; dst_w = psde->pipe_cfg.dst_rect.w; dst_h = psde->pipe_cfg.dst_rect.h; memset(scale_cfg, 0, sizeof(*scale_cfg)); - memset(&pstate->pixel_ext, 0, sizeof(struct sde_hw_pixel_ext)); + memset(&psde->pixel_ext, 0, sizeof(struct sde_hw_pixel_ext)); /* * For inline rotation cases, scaler config is post-rotation, @@ -912,14 +915,14 @@ static void _sde_plane_setup_scaler3(struct sde_plane *psde, /* For pixel extension we need the pre-rotated orientation */ if (inline_rotation) { - pstate->pixel_ext.num_ext_pxls_top[i] = + psde->pixel_ext.num_ext_pxls_top[i] = scale_cfg->src_width[i]; - pstate->pixel_ext.num_ext_pxls_left[i] = + psde->pixel_ext.num_ext_pxls_left[i] = scale_cfg->src_height[i]; } else { - pstate->pixel_ext.num_ext_pxls_top[i] = + psde->pixel_ext.num_ext_pxls_top[i] = scale_cfg->src_height[i]; - pstate->pixel_ext.num_ext_pxls_left[i] = + psde->pixel_ext.num_ext_pxls_left[i] = scale_cfg->src_width[i]; } } @@ -1271,8 +1274,13 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde, return; } + memcpy(&psde->scaler3_cfg, &pstate->scaler3_cfg, + sizeof(psde->scaler3_cfg)); + memcpy(&psde->pixel_ext, &pstate->pixel_ext, + sizeof(psde->pixel_ext)); + info = drm_format_info(fmt->base.pixel_format); - pe = &pstate->pixel_ext; + pe = &psde->pixel_ext; psde->pipe_cfg.horz_decimation = sde_plane_get_property(pstate, PLANE_PROP_H_DECIMATE); @@ -1441,13 +1449,13 @@ static int _sde_plane_color_fill(struct sde_plane *psde, if (psde->pipe_hw->ops.setup_pe) psde->pipe_hw->ops.setup_pe(psde->pipe_hw, - &pstate->pixel_ext); + &psde->pixel_ext); if (psde->pipe_hw->ops.setup_scaler && pstate->multirect_index != SDE_SSPP_RECT_1) { psde->pipe_hw->ctl = _sde_plane_get_hw_ctl(plane); psde->pipe_hw->ops.setup_scaler(psde->pipe_hw, - &psde->pipe_cfg, &pstate->pixel_ext, - &pstate->scaler3_cfg); + &psde->pipe_cfg, &psde->pixel_ext, + &psde->scaler3_cfg); } } @@ -3002,7 +3010,7 @@ static void _sde_plane_update_roi_config(struct drm_plane *plane, if (psde->pipe_hw->ops.setup_pe && (pstate->multirect_index != SDE_SSPP_RECT_1)) psde->pipe_hw->ops.setup_pe(psde->pipe_hw, - &pstate->pixel_ext); + &psde->pixel_ext); /** * when programmed in multirect mode, scalar block will be @@ -3013,8 +3021,8 @@ static void _sde_plane_update_roi_config(struct drm_plane *plane, pstate->multirect_index != SDE_SSPP_RECT_1) { psde->pipe_hw->ctl = _sde_plane_get_hw_ctl(plane); psde->pipe_hw->ops.setup_scaler(psde->pipe_hw, - &psde->pipe_cfg, &pstate->pixel_ext, - &pstate->scaler3_cfg); + &psde->pipe_cfg, &psde->pixel_ext, + &psde->scaler3_cfg); } /* update excl rect */