msm: camera: tfe: Add support for auto SHDR

This change add support for activate and deactivate ISP device in the
link when dual trigger mode in the link is set.

CRs-Fixed: 3374385
Change-Id: Ib6d25ab295d613fa5cd3edf1780362476920d74d
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
This commit is contained in:
Ayush Kumar
2022-12-28 17:01:03 +05:30
committed by Alok Chauhan
parent a90b42d899
commit 6e2c1b9671
12 changed files with 269 additions and 37 deletions

View File

@@ -5129,6 +5129,16 @@ static int __cam_isp_ctx_apply_req_in_activated_state(
ctx_isp->substate_activated = next_state;
ctx_isp->last_applied_req_id = apply->request_id;
ctx_isp->last_applied_jiffies = jiffies;
if (ctx_isp->is_tfe_shdr) {
if (ctx_isp->is_shdr_master && req_isp->hw_update_data.mup_en)
apply->dual_trigger_status = req_isp->hw_update_data.num_exp;
else
apply->dual_trigger_status = CAM_REQ_DUAL_TRIGGER_NONE;
} else {
apply->dual_trigger_status = CAM_REQ_DUAL_TRIGGER_NONE;
}
list_del_init(&req->list);
if (atomic_read(&ctx_isp->internal_recovery_set))
__cam_isp_ctx_enqueue_request_in_order(ctx, req, false);
@@ -6996,6 +7006,9 @@ 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;
if (ctx_isp->is_shdr_master && req_isp->hw_update_data.mup_en)
add_req.num_exp = req_isp->hw_update_data.num_exp;
rc = ctx->ctx_crm_intf->add_req(&add_req);
if (rc) {
if (rc == -EBADR)
@@ -7618,6 +7631,8 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx,
(param.op_flags & CAM_IFE_CTX_AEB_EN);
ctx_isp->mode_switch_en =
(param.op_flags & CAM_IFE_CTX_DYNAMIC_SWITCH_EN);
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,
@@ -7955,6 +7970,8 @@ static int __cam_isp_ctx_get_dev_info_in_acquired(struct cam_context *ctx,
struct cam_req_mgr_device_info *dev_info)
{
int rc = 0;
struct cam_isp_context *ctx_isp =
(struct cam_isp_context *) ctx->ctx_priv;
dev_info->dev_hdl = ctx->dev_hdl;
strlcpy(dev_info->name, CAM_ISP_DEV_NAME, sizeof(dev_info->name));
@@ -7963,6 +7980,8 @@ static int __cam_isp_ctx_get_dev_info_in_acquired(struct cam_context *ctx,
dev_info->m_delay = CAM_MODESWITCH_DELAY_1;
dev_info->trigger = CAM_TRIGGER_POINT_SOF;
dev_info->trigger_on = true;
dev_info->is_shdr = ctx_isp->is_tfe_shdr;
dev_info->is_shdr_master = ctx_isp->is_shdr_master;
return rc;
}