浏览代码

Merge "display: msm: sde: update qos lut after scaler config"

qctecmdr 4 年之前
父节点
当前提交
b0d2030f38
共有 3 个文件被更改,包括 27 次插入35 次删除
  1. 1 8
      msm/sde/sde_crtc.c
  2. 26 18
      msm/sde/sde_plane.c
  3. 0 9
      msm/sde/sde_plane.h

+ 1 - 8
msm/sde/sde_crtc.c

@@ -3375,7 +3375,6 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc,
 	struct drm_encoder *encoder;
 	struct drm_encoder *encoder;
 	struct drm_device *dev;
 	struct drm_device *dev;
 	struct sde_kms *sde_kms;
 	struct sde_kms *sde_kms;
-	struct drm_plane *plane;
 	struct sde_splash_display *splash_display;
 	struct sde_splash_display *splash_display;
 	bool cont_splash_enabled = false;
 	bool cont_splash_enabled = false;
 	size_t i;
 	size_t i;
@@ -3436,14 +3435,8 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc,
 	_sde_crtc_dest_scaler_setup(crtc);
 	_sde_crtc_dest_scaler_setup(crtc);
 	sde_cp_crtc_apply_noise(crtc, old_state);
 	sde_cp_crtc_apply_noise(crtc, old_state);
 
 
-	if (old_state->mode_changed) {
+	if (crtc->state->mode_changed)
 		sde_core_perf_crtc_update_uidle(crtc, true);
 		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
 	 * Since CP properties use AXI buffer to program the

+ 26 - 18
msm/sde/sde_plane.c

@@ -116,6 +116,9 @@ struct sde_plane {
 	struct sde_csc_cfg *csc_usr_ptr;
 	struct sde_csc_cfg *csc_usr_ptr;
 	struct sde_csc_cfg *csc_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;
 	const struct sde_sspp_sub_blks *pipe_sblk;
 
 
 	char pipe_name[SDE_NAME_SIZE];
 	char pipe_name[SDE_NAME_SIZE];
@@ -247,7 +250,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_hw_set_sspp_sid(sde_kms->hw_sid, psde->pipe, vm);
 }
 }
 
 
-void _sde_plane_set_qos_lut(struct drm_plane *plane,
+static void _sde_plane_set_qos_lut(struct drm_plane *plane,
 		struct drm_crtc *crtc,
 		struct drm_crtc *crtc,
 		struct drm_framebuffer *fb)
 		struct drm_framebuffer *fb)
 {
 {
@@ -297,7 +300,7 @@ void _sde_plane_set_qos_lut(struct drm_plane *plane,
 			lut_index = SDE_QOS_LUT_USAGE_MACROTILE;
 			lut_index = SDE_QOS_LUT_USAGE_MACROTILE;
 
 
 		creq_lut_index = lut_index * SDE_CREQ_LUT_TYPE_MAX;
 		creq_lut_index = lut_index * SDE_CREQ_LUT_TYPE_MAX;
-		if (pstate->scaler3_cfg.enable)
+		if (psde->scaler3_cfg.enable)
 			creq_lut_index += SDE_CREQ_LUT_TYPE_QSEED;
 			creq_lut_index += SDE_CREQ_LUT_TYPE_QSEED;
 	} else {
 	} else {
 		lut_index = SDE_QOS_LUT_USAGE_NRT;
 		lut_index = SDE_QOS_LUT_USAGE_NRT;
@@ -793,7 +796,7 @@ static int _sde_plane_setup_scaler3_lut(struct sde_plane *psde,
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
-	cfg = &pstate->scaler3_cfg;
+	cfg = &psde->scaler3_cfg;
 
 
 	cfg->dir_lut = msm_property_get_blob(
 	cfg->dir_lut = msm_property_get_blob(
 			&psde->property_info,
 			&psde->property_info,
@@ -817,7 +820,7 @@ static int _sde_plane_setup_scaler3lite_lut(struct sde_plane *psde,
 {
 {
 	struct sde_hw_scaler3_cfg *cfg;
 	struct sde_hw_scaler3_cfg *cfg;
 
 
-	cfg = &pstate->scaler3_cfg;
+	cfg = &psde->scaler3_cfg;
 
 
 	cfg->sep_lut = msm_property_get_blob(
 	cfg->sep_lut = msm_property_get_blob(
 			&psde->property_info,
 			&psde->property_info,
@@ -842,14 +845,14 @@ static void _sde_plane_setup_scaler3(struct sde_plane *psde,
 		return;
 		return;
 	}
 	}
 
 
-	scale_cfg = &pstate->scaler3_cfg;
+	scale_cfg = &psde->scaler3_cfg;
 	src_w = psde->pipe_cfg.src_rect.w;
 	src_w = psde->pipe_cfg.src_rect.w;
 	src_h = psde->pipe_cfg.src_rect.h;
 	src_h = psde->pipe_cfg.src_rect.h;
 	dst_w = psde->pipe_cfg.dst_rect.w;
 	dst_w = psde->pipe_cfg.dst_rect.w;
 	dst_h = psde->pipe_cfg.dst_rect.h;
 	dst_h = psde->pipe_cfg.dst_rect.h;
 
 
 	memset(scale_cfg, 0, sizeof(*scale_cfg));
 	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,
 	 * For inline rotation cases, scaler config is post-rotation,
@@ -911,14 +914,14 @@ static void _sde_plane_setup_scaler3(struct sde_plane *psde,
 
 
 		/* For pixel extension we need the pre-rotated orientation */
 		/* For pixel extension we need the pre-rotated orientation */
 		if (inline_rotation) {
 		if (inline_rotation) {
-			pstate->pixel_ext.num_ext_pxls_top[i] =
+			psde->pixel_ext.num_ext_pxls_top[i] =
 				scale_cfg->src_width[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];
 				scale_cfg->src_height[i];
 		} else {
 		} else {
-			pstate->pixel_ext.num_ext_pxls_top[i] =
+			psde->pixel_ext.num_ext_pxls_top[i] =
 				scale_cfg->src_height[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];
 				scale_cfg->src_width[i];
 		}
 		}
 	}
 	}
@@ -1325,8 +1328,13 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
 		return;
 		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);
 	info = drm_format_info(fmt->base.pixel_format);
-	pe = &pstate->pixel_ext;
+	pe = &psde->pixel_ext;
 
 
 	psde->pipe_cfg.horz_decimation =
 	psde->pipe_cfg.horz_decimation =
 		sde_plane_get_property(pstate, PLANE_PROP_H_DECIMATE);
 		sde_plane_get_property(pstate, PLANE_PROP_H_DECIMATE);
@@ -1495,13 +1503,13 @@ static int _sde_plane_color_fill(struct sde_plane *psde,
 
 
 		if (psde->pipe_hw->ops.setup_pe)
 		if (psde->pipe_hw->ops.setup_pe)
 			psde->pipe_hw->ops.setup_pe(psde->pipe_hw,
 			psde->pipe_hw->ops.setup_pe(psde->pipe_hw,
-					&pstate->pixel_ext);
+					&psde->pixel_ext);
 		if (psde->pipe_hw->ops.setup_scaler &&
 		if (psde->pipe_hw->ops.setup_scaler &&
 				pstate->multirect_index != SDE_SSPP_RECT_1) {
 				pstate->multirect_index != SDE_SSPP_RECT_1) {
 			psde->pipe_hw->ctl = _sde_plane_get_hw_ctl(plane);
 			psde->pipe_hw->ctl = _sde_plane_get_hw_ctl(plane);
 			psde->pipe_hw->ops.setup_scaler(psde->pipe_hw,
 			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);
 		}
 		}
 	}
 	}
 
 
@@ -3046,7 +3054,7 @@ static void _sde_plane_update_roi_config(struct drm_plane *plane,
 	if (psde->pipe_hw->ops.setup_pe &&
 	if (psde->pipe_hw->ops.setup_pe &&
 			(pstate->multirect_index != SDE_SSPP_RECT_1))
 			(pstate->multirect_index != SDE_SSPP_RECT_1))
 		psde->pipe_hw->ops.setup_pe(psde->pipe_hw,
 		psde->pipe_hw->ops.setup_pe(psde->pipe_hw,
-				&pstate->pixel_ext);
+				&psde->pixel_ext);
 
 
 	/**
 	/**
 	 * when programmed in multirect mode, scalar block will be
 	 * when programmed in multirect mode, scalar block will be
@@ -3057,8 +3065,8 @@ static void _sde_plane_update_roi_config(struct drm_plane *plane,
 			pstate->multirect_index != SDE_SSPP_RECT_1) {
 			pstate->multirect_index != SDE_SSPP_RECT_1) {
 		psde->pipe_hw->ctl = _sde_plane_get_hw_ctl(plane);
 		psde->pipe_hw->ctl = _sde_plane_get_hw_ctl(plane);
 		psde->pipe_hw->ops.setup_scaler(psde->pipe_hw,
 		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 */
 	/* update excl rect */
@@ -3302,7 +3310,7 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
 	_sde_plane_set_scanout(plane, pstate, &psde->pipe_cfg, fb);
 	_sde_plane_set_scanout(plane, pstate, &psde->pipe_cfg, fb);
 
 
 	is_rt = sde_crtc_is_rt_client(crtc, crtc->state);
 	is_rt = sde_crtc_is_rt_client(crtc, crtc->state);
-	if (is_rt != psde->is_rt_pipe) {
+	if (is_rt != psde->is_rt_pipe || crtc->state->mode_changed) {
 		psde->is_rt_pipe = is_rt;
 		psde->is_rt_pipe = is_rt;
 		pstate->dirty |= SDE_PLANE_DIRTY_QOS;
 		pstate->dirty |= SDE_PLANE_DIRTY_QOS;
 	}
 	}

+ 0 - 9
msm/sde/sde_plane.h

@@ -204,15 +204,6 @@ void sde_plane_ctl_flush(struct drm_plane *plane, struct sde_hw_ctl *ctl,
  */
  */
 void sde_plane_restore(struct drm_plane *plane);
 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
  * sde_plane_flush - final plane operations before commit flush
  * @plane: Pointer to drm plane structure
  * @plane: Pointer to drm plane structure