msm: camera: req_mgr: Correct slot status on mode update

CRM pd tbl dev mask need to be updated on mode switch in Auto SHDR,
so that the mode switch request and subsequent requests or slot should
be in ready state if request is submitted by all expected device
in a link. Also enabled error bit related to shdr mode switch in tfe.
Query dev info from CRM to ISP again on activate link call to know if
usecase is SHDR and to identify master and slave context.

CRs-Fixed: 3555900
Change-Id: Ie3ce093a453cda4bb5a9d8ddd31b4c8d2b2a69ed
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
This commit is contained in:
Ayush Kumar
2023-07-05 14:12:25 +05:30
committed by Alok Chauhan
parent 06afbd12b3
commit ee10bad9a9
9 changed files with 124 additions and 101 deletions

View File

@@ -6853,6 +6853,7 @@ static int __cam_isp_ctx_config_dev_in_top_state(
struct cam_packet *packet;
size_t remain_len = 0;
struct cam_hw_prepare_update_args cfg = {0};
struct cam_isp_prepare_hw_update_data *hw_update_data;
struct cam_req_mgr_add_request add_req;
struct cam_isp_context *ctx_isp =
(struct cam_isp_context *) ctx->ctx_priv;
@@ -6947,6 +6948,7 @@ static int __cam_isp_ctx_config_dev_in_top_state(
goto free_req_and_buf_tracker_list;
}
hw_update_data = cfg.priv;
req_isp->num_cfg = cfg.num_hw_update_entries;
req_isp->num_fence_map_out = cfg.num_out_map_entries;
req_isp->num_fence_map_in = cfg.num_in_map_entries;
@@ -6955,6 +6957,8 @@ static int __cam_isp_ctx_config_dev_in_top_state(
req_isp->bubble_detected = false;
req_isp->cdm_reset_before_apply = false;
req_isp->hw_update_data.packet = packet;
req_isp->hw_update_data.num_exp = hw_update_data->num_exp;
req_isp->hw_update_data.mup_en = hw_update_data->mup_en;
req->pf_data.packet_handle = cmd->packet_handle;
req->pf_data.packet_offset = cmd->offset;
req->pf_data.req = req;
@@ -6969,7 +6973,7 @@ static int __cam_isp_ctx_config_dev_in_top_state(
}
CAM_DBG(CAM_ISP,
"packet req-id:%lld, opcode:%d, num_entry:%d, num_fence_out: %d, num_fence_in: %d, ctx_idx: %u, link: 0x%x",
"packet req-id:%lld, opcode:%d, num_entry:%d, num_fence_out: %d, num_fence_in: %d, ctx: %u, link: 0x%x",
packet->header.request_id, req_isp->hw_update_data.packet_opcode_type,
req_isp->num_cfg, req_isp->num_fence_map_out, req_isp->num_fence_map_in,
ctx->ctx_id, ctx->link_hdl);
@@ -7011,9 +7015,12 @@ static int __cam_isp_ctx_config_dev_in_top_state(
add_req.link_hdl = ctx->link_hdl;
add_req.dev_hdl = ctx->dev_hdl;
add_req.req_id = req->request_id;
add_req.num_exp = ctx_isp->last_num_exp;
if (ctx_isp->is_shdr_master && req_isp->hw_update_data.mup_en)
if (req_isp->hw_update_data.mup_en) {
add_req.num_exp = req_isp->hw_update_data.num_exp;
ctx_isp->last_num_exp = add_req.num_exp;
}
rc = ctx->ctx_crm_intf->add_req(&add_req);
if (rc) {
if (rc == -EBADR)
@@ -7455,6 +7462,7 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx,
goto free_res;
}
ctx_isp->last_num_exp = 0;
ctx_isp->support_consumed_addr =
(param.op_flags & CAM_IFE_CTX_CONSUME_ADDR_EN);
ctx_isp->is_tfe_shdr = (param.op_flags & CAM_IFE_CTX_SHDR_EN);
@@ -7520,9 +7528,9 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx,
trace_cam_context_state("ISP", ctx);
CAM_INFO(CAM_ISP,
"Acquire success:session_hdl 0x%xs ctx_type %d ctx %u link: 0x%x hw_mgr_ctx: %u",
"Acquire success:session_hdl 0x%xs ctx_type %d ctx %u link: 0x%x hw_mgr_ctx: %u is_shdr %d is_shdr_master %d",
ctx->session_hdl, isp_hw_cmd_args.u.ctx_type, ctx->ctx_id, ctx->link_hdl,
param.hw_mgr_ctx_id);
param.hw_mgr_ctx_id, ctx_isp->is_tfe_shdr, ctx_isp->is_shdr_master);
kfree(acquire_hw_info);
return rc;
@@ -7628,6 +7636,7 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx,
* Set feature flag if applicable
* custom hw is supported only on v2
*/
ctx_isp->last_num_exp = 0;
ctx_isp->custom_enabled =
(param.op_flags & CAM_IFE_CTX_CUSTOM_EN);
ctx_isp->use_frame_header_ts =
@@ -7771,9 +7780,9 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx,
trace_cam_context_state("ISP", ctx);
CAM_INFO(CAM_ISP,
"Acquire success: session_hdl 0x%xs ctx_type %d ctx %u link: 0x%x hw_mgr_ctx: %u",
"Acquire success: session_hdl 0x%xs ctx_type %d ctx %u link 0x%x hw_mgr_ctx %u is_shdr %d is_shdr_master %d",
ctx->session_hdl, isp_hw_cmd_args.u.ctx_type, ctx->ctx_id, ctx->link_hdl,
param.hw_mgr_ctx_id);
param.hw_mgr_ctx_id, ctx_isp->is_tfe_shdr, ctx_isp->is_shdr_master);
kfree(acquire_hw_info);
return rc;
@@ -7975,7 +7984,7 @@ static int __cam_isp_ctx_unlink_in_acquired(struct cam_context *ctx,
return rc;
}
static int __cam_isp_ctx_get_dev_info_in_acquired(struct cam_context *ctx,
static int __cam_isp_ctx_get_dev_info(struct cam_context *ctx,
struct cam_req_mgr_device_info *dev_info)
{
int rc = 0;
@@ -8988,7 +8997,7 @@ static struct cam_ctx_ops
.crm_ops = {
.link = __cam_isp_ctx_link_in_acquired,
.unlink = __cam_isp_ctx_unlink_in_acquired,
.get_dev_info = __cam_isp_ctx_get_dev_info_in_acquired,
.get_dev_info = __cam_isp_ctx_get_dev_info,
.process_evt = __cam_isp_ctx_process_evt,
.flush_req = __cam_isp_ctx_flush_req_in_top_state,
.dump_req = __cam_isp_ctx_dump_in_top_state,
@@ -9009,6 +9018,7 @@ static struct cam_ctx_ops
},
.crm_ops = {
.unlink = __cam_isp_ctx_unlink_in_ready,
.get_dev_info = __cam_isp_ctx_get_dev_info,
.flush_req = __cam_isp_ctx_flush_req_in_ready,
.dump_req = __cam_isp_ctx_dump_in_top_state,
},