disp: msm: sde: avoid VMID_TVM check during buf import in trusted-vm
Both trusted-vm and secure-camera preview buffers uses the same VMID_TVM. In primary-vm, the check is used to determine the camera preview usecase and attach it to the correct device. This is not necessary for trusted-vm as it can default to nested trusted-vm context bank. Avoid the check while its in trusted-vm. Change-Id: I4391a4a1da9dca5d1f4b1719733b8d4edc1900a8 Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
This commit is contained in:
@@ -157,6 +157,8 @@ struct drm_gem_object *msm_gem_prime_import(struct drm_device *dev,
|
||||
}
|
||||
|
||||
#if (KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE)
|
||||
/* avoid VMID checks in trusted-vm */
|
||||
if (!kms->funcs->in_trusted_vm || !kms->funcs->in_trusted_vm(kms)) {
|
||||
ret = mem_buf_dma_buf_copy_vmperm(dma_buf, &vmid_list, &perms_list, &nelems);
|
||||
if (ret) {
|
||||
DRM_ERROR("get vmid list failure, ret:%d", ret);
|
||||
@@ -170,6 +172,7 @@ struct drm_gem_object *msm_gem_prime_import(struct drm_device *dev,
|
||||
/* mem_buf_dma_buf_copy_vmperm uses kmemdup, do kfree to free up the memory */
|
||||
kfree(vmid_list);
|
||||
kfree(perms_list);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (C) 2013 Red Hat
|
||||
* Author: Rob Clark <robdclark@gmail.com>
|
||||
@@ -140,6 +140,7 @@ struct msm_kms_funcs {
|
||||
/* topology dsc information */
|
||||
int (*get_dsc_count)(const struct msm_kms *kms,
|
||||
u32 hdisplay, u32 *num_dsc);
|
||||
bool (*in_trusted_vm)(const struct msm_kms *kms);
|
||||
};
|
||||
|
||||
struct msm_kms {
|
||||
|
@@ -3857,6 +3857,20 @@ static int sde_kms_get_dsc_count(const struct msm_kms *kms,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool sde_kms_in_trusted_vm(const struct msm_kms *kms)
|
||||
{
|
||||
struct sde_kms *sde_kms;
|
||||
|
||||
if (!kms) {
|
||||
SDE_ERROR("invalid kms\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
sde_kms = to_sde_kms(kms);
|
||||
|
||||
return sde_in_trusted_vm(sde_kms);
|
||||
}
|
||||
|
||||
static int _sde_kms_null_commit(struct drm_device *dev,
|
||||
struct drm_encoder *enc)
|
||||
{
|
||||
@@ -4295,6 +4309,7 @@ static const struct msm_kms_funcs kms_funcs = {
|
||||
.trigger_null_flush = sde_kms_trigger_null_flush,
|
||||
.get_mixer_count = sde_kms_get_mixer_count,
|
||||
.get_dsc_count = sde_kms_get_dsc_count,
|
||||
.in_trusted_vm = sde_kms_in_trusted_vm,
|
||||
};
|
||||
|
||||
static int _sde_kms_mmu_destroy(struct sde_kms *sde_kms)
|
||||
|
Reference in New Issue
Block a user