msm: camera: mem_mgr: Add dma_buf_vunmap to cam_compat

dma_buf_vunmap function signature changed between kernel version
5.10 and 5.15.

CRs-Fixed: 3088126
Change-Id: If6ef72aa7839e358bc6d7a384e628b760ecaf265
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
This commit is contained in:
zhuo
2021-11-30 19:22:49 +08:00
parent fdd4d2fbb1
commit cc2c7724f5
3 changed files with 14 additions and 1 deletions

View File

@@ -148,7 +148,7 @@ static int cam_mem_util_unmap_cpu_va(struct dma_buf *dmabuf,
return -EINVAL;
}
dma_buf_vunmap(dmabuf, (void *)vaddr);
cam_compat_util_put_dmabuf_va(dmabuf, (void *)vaddr);
/*
* dma_buf_begin_cpu_access() and

View File

@@ -354,6 +354,13 @@ int cam_compat_util_get_dmabuf_va(struct dma_buf *dmabuf, uintptr_t *vaddr)
return error_code;
}
void cam_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr)
{
struct dma_buf_map mapping = DMA_BUF_MAP_INIT_VADDR(vaddr);
dma_buf_vunmap(dmabuf, &mapping);
}
int cam_get_ddr_type(void)
{
/* We assume all chipsets running kernel version 5.15+
@@ -395,6 +402,11 @@ int cam_compat_util_get_dmabuf_va(struct dma_buf *dmabuf, uintptr_t *vaddr)
return error_code;
}
void cam_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr)
{
dma_buf_vunmap(dmabuf, vaddr);
}
int cam_get_ddr_type(void)
{
return of_fdt_get_ddrtype();

View File

@@ -49,6 +49,7 @@ void cam_check_iommu_faults(struct iommu_domain *domain,
struct cam_smmu_pf_info *pf_info);
int cam_get_ddr_type(void);
int cam_compat_util_get_dmabuf_va(struct dma_buf *dmabuf, uintptr_t *vaddr);
void cam_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr);
void cam_smmu_util_iommu_custom(struct device *dev,
dma_addr_t discard_start, size_t discard_length);