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>
This commit is contained in:
Gaurav Jindal
2020-10-13 00:37:41 +05:30
committed by Gerrit - the friendly Code Review server
parent c6b2796833
commit 1a5797c6a8
11 changed files with 254 additions and 32 deletions

View File

@@ -268,6 +268,9 @@ int cam_ope_context_init(struct cam_ope_context *ctx,
ctx->base->ctx_priv = ctx;
ctx->ctxt_to_hw_map = NULL;
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;
err:
return rc;
}