Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ac92ffb authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

drm: msm: sde: fix decimation validation in plane atomic_check



Fix the invalid decimation check which skips the validations
below when decimation is enabled. This fails to validate
few parameters and also miss updating few state variables
leading to various issues. Part of the change add an event
log to track when the driver qseed/PE settings are used.

Change-Id: I829d54d6b77b1ff39827b08a28f7edbb98ed8e24
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent 4126e402
Loading
Loading
Loading
Loading
+26 −12
Original line number Diff line number Diff line
@@ -1146,6 +1146,12 @@ static void _sde_plane_setup_scaler3(struct sde_plane *psde,
		&& (src_w == dst_w)) || pstate->multirect_mode)
		return;

	SDE_DEBUG_PLANE(psde,
		"setting bilinear: src:%dx%d dst:%dx%d chroma:%dx%d fmt:%x\n",
			src_w, src_h, dst_w, dst_h,
			chroma_subsmpl_v, chroma_subsmpl_h,
			fmt->base.pixel_format);

	scale_cfg->dst_width = dst_w;
	scale_cfg->dst_height = dst_h;
	scale_cfg->y_rgb_filter_cfg = SDE_SCALE_BIL;
@@ -1503,6 +1509,15 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
			rc = -EINVAL;
		if (rc || pstate->scaler_check_state !=
					SDE_PLANE_SCLCHECK_SCALER_V2) {
			SDE_EVT32(DRMID(&psde->base), color_fill,
					pstate->scaler_check_state,
					psde->debugfs_default_scale, rc,
					psde->pipe_cfg.src_rect.w,
					psde->pipe_cfg.src_rect.h,
					psde->pipe_cfg.dst_rect.w,
					psde->pipe_cfg.dst_rect.h,
					pstate->multirect_mode);

			/* calculate default config for QSEED3 */
			_sde_plane_setup_scaler3(psde, pstate, fmt,
					chroma_subsmpl_h, chroma_subsmpl_v);
@@ -3577,17 +3592,16 @@ static int sde_plane_sspp_atomic_check(struct drm_plane *plane,
		ret = -EINVAL;

	/* decimation validation */
	} else if (deci_w || deci_h) {
		if ((deci_w > psde->pipe_sblk->maxhdeciexp) ||
			(deci_h > psde->pipe_sblk->maxvdeciexp)) {
			SDE_ERROR_PLANE(psde,
					"too much decimation requested\n");
	} else if ((deci_w || deci_h)
			&& ((deci_w > psde->pipe_sblk->maxhdeciexp)
				|| (deci_h > psde->pipe_sblk->maxvdeciexp))) {
		SDE_ERROR_PLANE(psde, "too much decimation requested\n");
		ret = -EINVAL;
		} else if (fmt->fetch_mode != SDE_FETCH_LINEAR) {
			SDE_ERROR_PLANE(psde,
					"decimation requires linear fetch\n");

	} else if ((deci_w || deci_h)
			&& (fmt->fetch_mode != SDE_FETCH_LINEAR)) {
		SDE_ERROR_PLANE(psde, "decimation requires linear fetch\n");
		ret = -EINVAL;
		}

	} else if (!(psde->features & SDE_SSPP_SCALER) &&
		((src.w != dst.w) || (src.h != dst.h))) {