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

Commit 909d927f authored by Krishna Manikandan's avatar Krishna Manikandan Committed by Yashwanth
Browse files

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



If no planes are staged during non-secure to secure transition,
dim layer should be staged at the highest blend stage. Add
check to fail those commits where dim layer is not staged
in such scenarios.

Change-Id: Ifd49b00a8ff64547ea12751f6c765fd12e55629e
Signed-off-by: default avatarKrishna Manikandan <mkrishn@codeaurora.org>
parent 4b823cfd
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -4413,6 +4413,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
@@ -4473,6 +4476,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 :
@@ -4490,6 +4495,14 @@ 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) {
				SDE_ERROR(
				"crtc%d: no dim layer in nonsecure to secure transition\n",
					DRMID(crtc));
				return -EINVAL;
			}
		}
	}