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

Commit 27cdcfbd authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran
Browse files

drm/msm/sde: avoid VBIF programming during secure-ui session



Avoid all register programming related to VBIF during
secure-ui session when secure-ui-misr feature is enabled
as it would end up in SMMU fault.

Change-Id: I847242ed1b7c4ef0b86c198f5a252e8ba85c6458
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent 7b121cb6
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -371,6 +371,25 @@ static inline bool sde_kms_is_secure_session_inprogress(struct sde_kms *sde_kms)
	return ret;
}

/**
 * sde_kms_is_vbif_operation_allowed - resticts the VBIF programming
 * during secure-ui, if the sec_ui_misr feature is enabled
 *
 * @sde_kms: Pointer to sde_kms
 *
 * return: false if secure-session is in progress; true otherwise
 */
static inline bool sde_kms_is_vbif_operation_allowed(struct sde_kms *sde_kms)
{
	if (!sde_kms)
		return false;

	if (!sde_kms->catalog->sui_misr_supported)
		return true;

	return !sde_kms_is_secure_session_inprogress(sde_kms);
}

/**
 * Debugfs functions - extra helper functions for debugfs support
 *
+34 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -73,6 +73,11 @@ int sde_vbif_halt_plane_xin(struct sde_kms *sde_kms, u32 xin_id, u32 clk_ctrl)
		return -EINVAL;
	}

	if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
		SDE_DEBUG("vbif operations not permitted\n");
		return 0;
	}

	vbif = sde_kms->hw_vbif[VBIF_RT];
	mdp = sde_kms->hw_mdp;
	if (!vbif || !mdp || !vbif->ops.get_halt_ctrl ||
@@ -225,6 +230,12 @@ void sde_vbif_set_ot_limit(struct sde_kms *sde_kms,
		SDE_ERROR("invalid arguments\n");
		return;
	}

	if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
		SDE_DEBUG("vbif operations not permitted\n");
		return;
	}

	mdp = sde_kms->hw_mdp;

	for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
@@ -293,6 +304,12 @@ bool sde_vbif_set_xin_halt(struct sde_kms *sde_kms,
		SDE_ERROR("invalid arguments\n");
		return false;
	}

	if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
		SDE_DEBUG("vbif operations not permitted\n");
		return true;
	}

	mdp = sde_kms->hw_mdp;

	for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
@@ -352,6 +369,12 @@ void sde_vbif_set_qos_remap(struct sde_kms *sde_kms,
		SDE_ERROR("invalid arguments\n");
		return;
	}

	if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
		SDE_DEBUG("vbif operations not permitted\n");
		return;
	}

	mdp = sde_kms->hw_mdp;

	for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
@@ -408,6 +431,11 @@ void sde_vbif_clear_errors(struct sde_kms *sde_kms)
		return;
	}

	if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
		SDE_DEBUG("vbif operations not permitted\n");
		return;
	}

	for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
		vbif = sde_kms->hw_vbif[i];
		if (vbif && vbif->ops.clear_errors) {
@@ -433,6 +461,11 @@ void sde_vbif_init_memtypes(struct sde_kms *sde_kms)
		return;
	}

	if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
		SDE_DEBUG("vbif operations not permitted\n");
		return;
	}

	for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
		vbif = sde_kms->hw_vbif[i];
		if (vbif && vbif->cap && vbif->ops.set_mem_type) {