Skip to content

Commit 336a8f5

Browse files
committed
msm: camera: icp: Enable Cache Flag for ICP HFI Memory Allocation
This change improves memory allocation flexibility and enables caching for ICP firmware memory, which can reduce latency and improve throughput. Change-Id: I958fd0a502c6cd3e517c561dc6b2d1fe5dc6054d Signed-off-by: Chandan Kumar Jha <cjha@qti.qualcomm.com>
1 parent b832872 commit 336a8f5

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

camera/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3575,7 +3575,7 @@ static int cam_icp_allocate_hfi_mem(struct cam_icp_hw_mgr *hw_mgr)
35753575
alloc.size = qtbl_size + cmdq_size + msgq_size + dbgq_size +
35763576
sfr_size + sec_heap_size;
35773577
alloc.align = 0;
3578-
alloc.flags = CAM_MEM_FLAG_KMD_ACCESS;
3578+
alloc.flags = CAM_MEM_FLAG_KMD_ACCESS | CAM_MEM_FLAG_CACHE;
35793579
alloc.smmu_hdl = hw_mgr->iommu_hdl;
35803580
rc = cam_mem_mgr_reserve_memory_region(&alloc,
35813581
CAM_SMMU_REGION_FWUNCACHED, &out);

camera/drivers/cam_req_mgr/cam_mem_mgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,8 @@ int cam_mem_mgr_reserve_memory_region(struct cam_mem_mgr_request_desc *inp,
23752375
return -EINVAL;
23762376
}
23772377

2378-
rc = cam_mem_util_get_dma_buf(inp->size, 0, CAM_MEMMGR_ALLOC_KERNEL, &buf, &i_ino);
2378+
rc = cam_mem_util_get_dma_buf(inp->size, inp->flags,
2379+
CAM_MEMMGR_ALLOC_KERNEL, &buf, &i_ino);
23792380

23802381
if (rc) {
23812382
CAM_ERR(CAM_MEM, "ION alloc failed for sec heap buffer");

0 commit comments

Comments
 (0)