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

Commit 372beb45 authored by Shubhashree Dhar's avatar Shubhashree Dhar
Browse files

drm/msm/sde: validate plane roi for destination scaler usecase



Validate plane roi within lm boundaries for destination
scaler usecase.

Change-Id: I4f624e0f8fe5a835bf5c00175d58d7d4e95176f8
Signed-off-by: default avatarShubhashree Dhar <dhar@codeaurora.org>
parent 352168b1
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -5302,6 +5302,23 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc,
	mixer_width = sde_crtc_get_mixer_width(sde_crtc, cstate, mode);
	mixer_height = sde_crtc_get_mixer_height(sde_crtc, cstate, mode);

	if (cstate->num_ds_enabled) {
		if (!state->state)
			goto end;

		drm_atomic_crtc_state_for_each_plane_state(plane,
							pstate, state) {
			if ((pstate->crtc_h > mixer_height) ||
					(pstate->crtc_w > mixer_width)) {
				SDE_ERROR("plane w/h:%x*%x > mixer w/h:%x*%x\n",
					pstate->crtc_w, pstate->crtc_h,
					mixer_width, mixer_height);
				return -E2BIG;
				goto end;
			}
		}
	}

	_sde_crtc_setup_is_ppsplit(state);
	_sde_crtc_setup_lm_bounds(crtc, state);

@@ -5365,15 +5382,6 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc,

		cnt++;

		if ((pstate->crtc_h > mixer_height) ||
		 (pstate->crtc_w > (mixer_width * sde_crtc->num_mixers))) {
			SDE_ERROR("plane w/h:%x*%x more than mixer w/h:%x*%x\n",
			pstate->crtc_w, pstate->crtc_h,
			sde_crtc->num_mixers * mixer_width, mixer_height);
			rc = -E2BIG;
			goto end;
		}

		if (CHECK_LAYER_BOUNDS(pstate->crtc_y, pstate->crtc_h,
				mode->vdisplay) ||
		    CHECK_LAYER_BOUNDS(pstate->crtc_x, pstate->crtc_w,