|
@@ -6667,6 +6667,8 @@ static int __cam_isp_ctx_flush_dev_in_top_state(struct cam_context *ctx,
|
|
|
static void __cam_isp_ctx_free_mem_hw_entries(struct cam_context *ctx)
|
|
|
{
|
|
|
int i;
|
|
|
+ struct cam_isp_context *ctx_isp =
|
|
|
+ (struct cam_isp_context *) ctx->ctx_priv;
|
|
|
|
|
|
if (ctx->out_map_entries) {
|
|
|
for (i = 0; i < CAM_ISP_CTX_REQ_MAX; i++) {
|
|
@@ -6698,6 +6700,13 @@ static void __cam_isp_ctx_free_mem_hw_entries(struct cam_context *ctx)
|
|
|
ctx->hw_update_entry = NULL;
|
|
|
}
|
|
|
|
|
|
+ if (ctx_isp) {
|
|
|
+ for (i = 0; i < CAM_ISP_CTX_REQ_MAX; i++) {
|
|
|
+ kfree(ctx_isp->req_isp[i].deferred_fence_map_index);
|
|
|
+ ctx_isp->req_isp[i].deferred_fence_map_index = NULL;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
ctx->max_out_map_entries = 0;
|
|
|
ctx->max_in_map_entries = 0;
|
|
|
ctx->max_hw_update_entries = 0;
|
|
@@ -7090,6 +7099,8 @@ static int __cam_isp_ctx_allocate_mem_hw_entries(
|
|
|
struct cam_ctx_request *req;
|
|
|
struct cam_ctx_request *temp_req;
|
|
|
struct cam_isp_ctx_req *req_isp;
|
|
|
+ struct cam_isp_context *ctx_isp =
|
|
|
+ (struct cam_isp_context *) ctx->ctx_priv;
|
|
|
|
|
|
if (!param->op_params.param_list[0])
|
|
|
max_res = CAM_ISP_CTX_RES_MAX;
|
|
@@ -7119,16 +7130,6 @@ static int __cam_isp_ctx_allocate_mem_hw_entries(
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
- for (i = 0; i < CAM_ISP_CTX_REQ_MAX; i++) {
|
|
|
- ctx->hw_update_entry[i] = kcalloc(ctx->max_hw_update_entries,
|
|
|
- sizeof(struct cam_hw_update_entry), GFP_KERNEL);
|
|
|
- if (!ctx->hw_update_entry[i]) {
|
|
|
- CAM_ERR(CAM_CTXT, "%s[%u] no memory for hw_update_entry: %u, link: 0x%x",
|
|
|
- ctx->dev_name, ctx->ctx_id, i, ctx->link_hdl);
|
|
|
- return -ENOMEM;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
ctx->in_map_entries = kcalloc(CAM_ISP_CTX_REQ_MAX, sizeof(struct cam_hw_fence_map_entry *),
|
|
|
GFP_KERNEL);
|
|
|
|
|
@@ -7139,7 +7140,28 @@ static int __cam_isp_ctx_allocate_mem_hw_entries(
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
+ ctx->out_map_entries = kcalloc(CAM_ISP_CTX_REQ_MAX, sizeof(struct cam_hw_fence_map_entry *),
|
|
|
+ GFP_KERNEL);
|
|
|
+
|
|
|
+ if (!ctx->out_map_entries) {
|
|
|
+ CAM_ERR(CAM_CTXT, "%s[%u] no memory for out_map_entries, link: 0x%x",
|
|
|
+ ctx->dev_name, ctx->ctx_id, ctx->link_hdl);
|
|
|
+ rc = -ENOMEM;
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
for (i = 0; i < CAM_ISP_CTX_REQ_MAX; i++) {
|
|
|
+ ctx->hw_update_entry[i] = kcalloc(ctx->max_hw_update_entries,
|
|
|
+ sizeof(struct cam_hw_update_entry), GFP_KERNEL);
|
|
|
+
|
|
|
+ if (!ctx->hw_update_entry[i]) {
|
|
|
+ CAM_ERR(CAM_CTXT, "%s[%u] no memory for hw_update_entry: %u, link: 0x%x",
|
|
|
+ ctx->dev_name, ctx->ctx_id, i, ctx->link_hdl);
|
|
|
+ rc = -ENOMEM;
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
ctx->in_map_entries[i] = kcalloc(ctx->max_in_map_entries,
|
|
|
sizeof(struct cam_hw_fence_map_entry),
|
|
|
GFP_KERNEL);
|
|
@@ -7150,19 +7172,7 @@ static int __cam_isp_ctx_allocate_mem_hw_entries(
|
|
|
rc = -ENOMEM;
|
|
|
goto end;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- ctx->out_map_entries = kcalloc(CAM_ISP_CTX_REQ_MAX, sizeof(struct cam_hw_fence_map_entry *),
|
|
|
- GFP_KERNEL);
|
|
|
|
|
|
- if (!ctx->out_map_entries) {
|
|
|
- CAM_ERR(CAM_CTXT, "%s[%u] no memory for out_map_entries, link: 0x%x",
|
|
|
- ctx->dev_name, ctx->ctx_id, ctx->link_hdl);
|
|
|
- rc = -ENOMEM;
|
|
|
- goto end;
|
|
|
- }
|
|
|
-
|
|
|
- for (i = 0; i < CAM_ISP_CTX_REQ_MAX; i++) {
|
|
|
ctx->out_map_entries[i] = kcalloc(ctx->max_out_map_entries,
|
|
|
sizeof(struct cam_hw_fence_map_entry),
|
|
|
GFP_KERNEL);
|
|
@@ -7173,6 +7183,16 @@ static int __cam_isp_ctx_allocate_mem_hw_entries(
|
|
|
rc = -ENOMEM;
|
|
|
goto end;
|
|
|
}
|
|
|
+
|
|
|
+ ctx_isp->req_isp[i].deferred_fence_map_index = kcalloc(param->total_ports_acq,
|
|
|
+ sizeof(uint32_t), GFP_KERNEL);
|
|
|
+
|
|
|
+ if (!ctx_isp->req_isp[i].deferred_fence_map_index) {
|
|
|
+ CAM_ERR(CAM_ISP, "%s[%d] no memory for defer fence map idx arr, ports:%u",
|
|
|
+ ctx->dev_name, ctx->ctx_id, param->total_ports_acq);
|
|
|
+ rc = -ENOMEM;
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
list_for_each_entry_safe(req, temp_req,
|