msm: camera: smmu: Add support for Camera Security Framework 2.5
Query the CSF version in use from SMMU proxy driver and use noncontiguous system heap in case of CSF 2.5 instead of the contiguous secure display heap. In addition, do not lend the buffer in CSF 2.5. CRs-Fixed: 3424427 Change-Id: I3d5f2402034dd455c304d5726eb9aa8ee2080dcc Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
This commit is contained in:

committed by
Camera Software Integration

parent
8c38f564e3
commit
6dc4887fd9
@@ -111,6 +111,47 @@ int cam_cpas_drv_channel_switch_for_dev(const struct device *dev)
|
||||
}
|
||||
#endif
|
||||
|
||||
int cam_smmu_fetch_csf_version(struct cam_csf_version *csf_version)
|
||||
{
|
||||
#if KERNEL_VERSION(6, 0, 0) <= LINUX_VERSION_CODE
|
||||
struct csf_version csf_ver;
|
||||
int rc;
|
||||
|
||||
/* Fetch CSF version from SMMU proxy driver */
|
||||
rc = smmu_proxy_get_csf_version(&csf_ver);
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_SMMU,
|
||||
"Failed to get CSF version from SMMU proxy: %d", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
csf_version->arch_ver = csf_ver.arch_ver;
|
||||
csf_version->max_ver = csf_ver.max_ver;
|
||||
csf_version->min_ver = csf_ver.min_ver;
|
||||
#else
|
||||
/* This defaults to the legacy version */
|
||||
csf_version->arch_ver = 2;
|
||||
csf_version->max_ver = 0;
|
||||
csf_version->min_ver = 0;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long cam_update_dma_map_attributes(unsigned long attrs)
|
||||
{
|
||||
#if KERNEL_VERSION(6, 0, 0) <= LINUX_VERSION_CODE
|
||||
attrs |= DMA_ATTR_QTI_SMMU_PROXY_MAP;
|
||||
#endif
|
||||
return attrs;
|
||||
}
|
||||
|
||||
size_t cam_align_dma_buf_size(size_t len)
|
||||
{
|
||||
#if KERNEL_VERSION(6, 0, 0) <= LINUX_VERSION_CODE
|
||||
len = ALIGN(len, SMMU_PROXY_MEM_ALIGNMENT);
|
||||
#endif
|
||||
return len;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
|
||||
int cam_reserve_icp_fw(struct cam_fw_alloc_info *icp_fw, size_t fw_length)
|
||||
|
Reference in New Issue
Block a user