msm: camera: smmu: Remove extra shared mem map
Cleans up extra mapping used to get the scatter list entries. CRs-Fixed: 2702021 Change-Id: I787159169e3b3d1259e41e51c0534bd68bcbb326 Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org> Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
This commit is contained in:

committed by
Pavan Kumar Chilamkurthi

parent
2395072fee
commit
018cb6845f
@@ -1933,7 +1933,7 @@ static int cam_smmu_map_buffer_validate(struct dma_buf *buf,
|
|||||||
} else {
|
} else {
|
||||||
CAM_ERR(CAM_SMMU, "Error: Wrong region id passed");
|
CAM_ERR(CAM_SMMU, "Error: Wrong region id passed");
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
goto err_unmap_sg;
|
goto err_detach;
|
||||||
}
|
}
|
||||||
|
|
||||||
CAM_DBG(CAM_SMMU,
|
CAM_DBG(CAM_SMMU,
|
||||||
@@ -1989,6 +1989,10 @@ static int cam_smmu_map_buffer_validate(struct dma_buf *buf,
|
|||||||
idx, buf, (void *)iommu_cb_set.cb_info[idx].dev,
|
idx, buf, (void *)iommu_cb_set.cb_info[idx].dev,
|
||||||
(void *)*paddr_ptr, (unsigned int)*len_ptr);
|
(void *)*paddr_ptr, (unsigned int)*len_ptr);
|
||||||
|
|
||||||
|
/* Unmap the mapping in dma region as this is not used anyway */
|
||||||
|
if (region_id == CAM_SMMU_REGION_SHARED)
|
||||||
|
dma_buf_unmap_attachment(attach, table, dma_dir);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_alloc:
|
err_alloc:
|
||||||
@@ -2135,14 +2139,16 @@ static int cam_smmu_unmap_buf_and_remove_from_list(
|
|||||||
iommu_cb_set.cb_info[idx].shared_mapping_size -=
|
iommu_cb_set.cb_info[idx].shared_mapping_size -=
|
||||||
mapping_info->len;
|
mapping_info->len;
|
||||||
} else if (mapping_info->region_id == CAM_SMMU_REGION_IO) {
|
} else if (mapping_info->region_id == CAM_SMMU_REGION_IO) {
|
||||||
iommu_cb_set.cb_info[idx].io_mapping_size -= mapping_info->len;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mapping_info->is_internal)
|
if (mapping_info->is_internal)
|
||||||
mapping_info->attach->dma_map_attrs |= DMA_ATTR_SKIP_CPU_SYNC;
|
mapping_info->attach->dma_map_attrs |=
|
||||||
|
DMA_ATTR_SKIP_CPU_SYNC;
|
||||||
|
|
||||||
dma_buf_unmap_attachment(mapping_info->attach,
|
dma_buf_unmap_attachment(mapping_info->attach,
|
||||||
mapping_info->table, mapping_info->dir);
|
mapping_info->table, mapping_info->dir);
|
||||||
|
iommu_cb_set.cb_info[idx].io_mapping_size -= mapping_info->len;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dma_buf_detach(mapping_info->buf, mapping_info->attach);
|
dma_buf_detach(mapping_info->buf, mapping_info->attach);
|
||||||
dma_buf_put(mapping_info->buf);
|
dma_buf_put(mapping_info->buf);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user