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

Commit 8e7ab077 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents cea57839 372beb45
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,