cam: isp: tfe: add query cap for comp grp in legacy acquire

Query the context bus comp group information in legacy acquire
call.

CRs-Fixed: 3696470
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
Change-Id: Ib80858e6b81e1c7fce2e00597f58f0a98e12ff87
This commit is contained in:
Alok Chauhan
2023-12-21 15:33:31 +05:30
parent 56dcfa4e56
commit b94a4a15d0

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/debugfs.h>
@@ -2243,7 +2243,7 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr(
comp_grp = &ctx_isp->vfe_bus_comp_grp[done->comp_group_id];
if (!comp_grp) {
CAM_ERR(CAM_ISP, "comp_grp is NULL");
CAM_ERR(CAM_ISP, "comp_grp is NULL for hw_type: %d", done->hw_type);
rc = -EINVAL;
return rc;
}
@@ -7393,6 +7393,7 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx,
struct cam_hw_cmd_args hw_cmd_args;
struct cam_isp_hw_cmd_args isp_hw_cmd_args;
struct cam_isp_acquire_hw_info *acquire_hw_info = NULL;
struct cam_isp_comp_record_query query_cmd;
if (!ctx->hw_mgr_intf) {
CAM_ERR(CAM_ISP, "HW interface is not ready, ctx %u link: 0x%x",
@@ -7468,6 +7469,30 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx,
ctx_isp->is_tfe_shdr = (param.op_flags & CAM_IFE_CTX_SHDR_EN);
ctx_isp->is_shdr_master = (param.op_flags & CAM_IFE_CTX_SHDR_IS_MASTER);
/* Query the context bus comp group information */
ctx_isp->vfe_bus_comp_grp = kcalloc(CAM_IFE_BUS_COMP_NUM_MAX,
sizeof(struct cam_isp_context_comp_record), GFP_KERNEL);
if (!ctx_isp->vfe_bus_comp_grp) {
CAM_ERR(CAM_CTXT, "%s[%d] no memory for vfe_bus_comp_grp",
ctx->dev_name, ctx->ctx_id);
rc = -ENOMEM;
goto free_hw;
}
query_cmd.vfe_bus_comp_grp = ctx_isp->vfe_bus_comp_grp;
hw_cmd_args.ctxt_to_hw_map = param.ctxt_to_hw_map;
hw_cmd_args.cmd_type = CAM_HW_MGR_CMD_INTERNAL;
isp_hw_cmd_args.cmd_type = CAM_ISP_HW_MGR_GET_BUS_COMP_GROUP;
isp_hw_cmd_args.cmd_data = &query_cmd;
hw_cmd_args.u.internal_args = (void *)&isp_hw_cmd_args;
rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv,
&hw_cmd_args);
if (rc) {
CAM_ERR(CAM_ISP, "Bus Comp HW command failed, ctx_idx: %u, link: 0x%x",
ctx->ctx_id, ctx->link_hdl);
goto free_hw;
}
/* Query the context has rdi only resource */
hw_cmd_args.ctxt_to_hw_map = param.ctxt_to_hw_map;
hw_cmd_args.cmd_type = CAM_HW_MGR_CMD_INTERNAL;