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

Commit e4cc5019 authored by Yashwanth's avatar Yashwanth
Browse files

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



During secure UI transition, if planes are not being staged
in last non-secure commit, dim layer should be staged at
highest blend stage due to topology lockdown. This change
handles atomic check in such scenarios.

Change-Id: I0bbc862e4989e72f966a35d45537adc2d3943fb7
Signed-off-by: default avatarYashwanth <yvulapu@codeaurora.org>
parent 454ccc1e
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;
			}
		}
	}