disp: msm: sde: add helper api to check executing VM

Adds a DT property to indicate trusted VM execution
environment and support catalog parsing for the same.
Add helper API to read the value.

Change-Id: I9194618b6f080119f1f15271a9b3c7edf938ca08
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
This commit is contained in:
Jeykumar Sankaran
2020-05-19 19:40:09 -07:00
parent b87b13690b
commit cb4f390241
3 changed files with 20 additions and 0 deletions

View File

@@ -201,6 +201,7 @@ enum sde_prop {
PIPE_ORDER_VERSION,
SEC_SID_MASK,
BASE_LAYER,
TRUSTED_VM_ENV,
SDE_PROP_MAX,
};
@@ -571,6 +572,7 @@ static struct sde_prop_type sde_prop[] = {
PROP_TYPE_U32},
{SEC_SID_MASK, "qcom,sde-secure-sid-mask", false, PROP_TYPE_U32_ARRAY},
{BASE_LAYER, "qcom,sde-mixer-stage-base-layer", false, PROP_TYPE_BOOL},
{TRUSTED_VM_ENV, "qcom,sde-trusted-vm-env", false, PROP_TYPE_BOOL},
};
static struct sde_prop_type sde_perf_prop[] = {
@@ -3733,6 +3735,8 @@ static void _sde_top_parse_dt_helper(struct sde_mdss_cfg *cfg,
cfg->has_base_layer = PROP_VALUE_ACCESS(props->values, BASE_LAYER, 0);
cfg->qseed_hw_version = PROP_VALUE_ACCESS(props->values,
QSEED_HW_VERSION, 0);
cfg->trusted_vm_env = PROP_VALUE_ACCESS(props->values, TRUSTED_VM_ENV,
0);
}
static int sde_top_parse_dt(struct device_node *np, struct sde_mdss_cfg *cfg)

View File

@@ -1360,6 +1360,8 @@ struct sde_perf_cfg {
* this HW version. Contains number of instances,
* register offsets, capabilities of the all MDSS HW sub-blocks.
*
* @trusted_vm_env set to true, if the driver is executing in
* the trusted VM. false, otherwise.
* @max_sspp_linewidth max source pipe line width support.
* @vig_sspp_linewidth max vig source pipe line width support.
* @scaling_linewidth max vig source pipe linewidth for scaling usecases
@@ -1432,6 +1434,7 @@ struct sde_perf_cfg {
*/
struct sde_mdss_cfg {
u32 hwversion;
bool trusted_vm_env;
u32 max_sspp_linewidth;
u32 vig_sspp_linewidth;

View File

@@ -642,6 +642,19 @@ static inline bool sde_kms_rect_is_null(const struct sde_rect *r)
return (!r->w || !r->h);
}
/*
* sde_in_trusted_vm - checks the executing VM
* return: true, if the device driver is executing in the trusted VM
* false, if the device driver is executing in the primary VM
*/
static inline bool sde_in_trusted_vm(const struct sde_kms *sde_kms)
{
if (sde_kms && sde_kms->catalog)
return sde_kms->catalog->trusted_vm_env;
return false;
}
/**
* Vblank enable/disable functions
*/