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

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

Merge "disp: msm: sde: add dim layer check during secure transition"

parents 5923262f e4cc5019
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -4203,6 +4203,9 @@ static int _sde_crtc_check_secure_blend_config(struct drm_crtc *crtc,
{
	struct drm_plane *plane;
	int i;
	struct drm_crtc_state *old_state = crtc->state;
	struct sde_crtc_state *old_cstate = to_sde_crtc_state(old_state);

	if (secure == SDE_DRM_SEC_ONLY) {
		/*
		 * validate planes - only fb_sec_dir is allowed during sec_crtc
@@ -4263,6 +4266,8 @@ static int _sde_crtc_check_secure_blend_config(struct drm_crtc *crtc,
		 * - fail empty commit
		 * - validate dim_layer or plane is staged in the supported
		 *   blendstage
		 * - fail if previous commit has no planes staged and
		 *   no dim layer at highest blendstage.
		 */
		if (sde_kms->catalog->sui_supported_blendstage) {
			int sec_stage = cnt ? pstates[0].sde_pstate->stage :
@@ -4280,6 +4285,16 @@ static int _sde_crtc_check_secure_blend_config(struct drm_crtc *crtc,
					cstate->num_dim_layers, sec_stage);
				return -EINVAL;
			}

			if (!old_state->plane_mask &&
				(!old_cstate->num_dim_layers ||
				(old_cstate->dim_layer[0].stage !=
				sde_kms->catalog->sui_supported_blendstage))) {
				SDE_ERROR(
				"crtc%d: no dim layer in nonsecure to secure transition\n",
					DRMID(crtc));
				return -EINVAL;
			}
		}
	}