msm: camera: common: Optimize cam context memory

In current implementation, cam_ctx_req has a array of
hw_update_entries, in_map_entries and out_map_entries. Each
context has array of N requests. Memory for all contexts is
allocated during probe. This causes a huge memory remaining
unutilized.
This commit moves the memory allocation to context acquire time
and freeing this memory during context release. In place
of using array, now dynamic allocation is used.
A top level calculation shows a memory reduction of around 2M-
2.5M with this change including all the camera drivers.

CRs-Fixed: 2830502
Change-Id: Id63cf2a52272e2a419704dc95100694e384330c3
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
这个提交包含在:
Gaurav Jindal
2020-10-13 00:37:41 +05:30
提交者 Gerrit - the friendly Code Review server
父节点 c6b2796833
当前提交 1a5797c6a8
修改 11 个文件,包含 254 行新增32 行删除

查看文件

@@ -1729,6 +1729,9 @@ int cam_custom_dev_context_init(struct cam_custom_context *ctx,
return rc;
}
ctx_base->max_hw_update_entries = CAM_CTX_CFG_MAX;
ctx_base->max_in_map_entries = CAM_CTX_CFG_MAX;
ctx_base->max_out_map_entries = CAM_CTX_CFG_MAX;
/* link camera context with custom HW context */
ctx_base->state_machine = cam_custom_dev_ctx_top_state_machine;
ctx_base->ctx_priv = ctx;