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

Commit 13d91473 authored by Clarence Ip's avatar Clarence Ip
Browse files

drm/msm/sde: reject large downscale during inline rotation



Reject any vertical downscale greater than or equal to 1.1x
in the planes whenever inline rotation for video mode is
enabled. This matches a hardware requirement to allow the
rotator hardware to finish before the fixed rotate start
time.

Change-Id: I0f42d6f1df243a643b3ca5ca31fcc4d005033309
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent 12755010
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -2379,6 +2379,29 @@ static int sde_plane_rot_atomic_check(struct drm_plane *plane,
					(u64) &rstate->rot_hw->base);
			rstate->out_fbo = NULL;
		}

		/*
		 * For video mode, reject any downscale factor greater than or
		 * equal to 1.1x
		 *
		 * Check the downscale factor first to avoid querying the
		 * interface mode unnecessarily.
		 */
		if ((rstate->out_src_h >> 16) * 10 >= state->crtc_h * 11 &&
				sde_crtc_get_intf_mode(state->crtc) ==
				INTF_MODE_VIDEO) {
			SDE_DEBUG_PLANE(psde,
					"inline %d with invalid scale, %dx%d, %dx%d\n",
					rstate->sequence_id,
					rstate->out_src_w, rstate->out_src_h,
					state->crtc_w, state->crtc_h);
			SDE_EVT32(DRMID(plane), rstate->sequence_id,
					rstate->out_src_w >> 16,
					rstate->out_src_h >> 16,
					state->crtc_w, state->crtc_h,
					SDE_EVTLOG_ERROR);
			return -EINVAL;
		}
	} else {

		SDE_DEBUG("plane%d.%d bypass rotator\n", plane->base.id,