Loading drivers/cam_isp/cam_isp_context.c +36 −8 Original line number Diff line number Diff line Loading @@ -629,6 +629,7 @@ static void __cam_isp_ctx_send_sof_boot_timestamp( req_msg.u.frame_msg.timestamp = ctx_isp->boot_timestamp; req_msg.u.frame_msg.link_hdl = ctx_isp->base->link_hdl; req_msg.u.frame_msg.sof_status = sof_event_status; req_msg.u.frame_msg.frame_id_meta = ctx_isp->frame_id_meta; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld boot time stamp:0x%llx", Loading Loading @@ -656,6 +657,7 @@ static void __cam_isp_ctx_send_sof_timestamp( req_msg.u.frame_msg.timestamp = ctx_isp->sof_timestamp_val; req_msg.u.frame_msg.link_hdl = ctx_isp->base->link_hdl; req_msg.u.frame_msg.sof_status = sof_event_status; req_msg.u.frame_msg.frame_id_meta = ctx_isp->frame_id_meta; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld SOF time stamp:0x%llx", Loading Loading @@ -1040,11 +1042,20 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( struct cam_isp_context *ctx_isp, void *evt_data) { int rc = 0; uint64_t request_id = 0; struct cam_req_mgr_trigger_notify notify; struct cam_context *ctx = ctx_isp->base; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; uint64_t request_id = 0; struct cam_isp_hw_epoch_event_data *epoch_done_event_data = (struct cam_isp_hw_epoch_event_data *)evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "invalid event data"); return -EINVAL; } ctx_isp->frame_id_meta = epoch_done_event_data->frame_id_meta; /* * notify reqmgr with sof signal. Note, due to scheduling delay Loading Loading @@ -1261,11 +1272,19 @@ static int __cam_isp_ctx_reg_upd_in_sof(struct cam_isp_context *ctx_isp, static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, void *evt_data) { uint64_t request_id = 0; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; struct cam_context *ctx = ctx_isp->base; uint64_t request_id = 0; struct cam_isp_hw_epoch_event_data *epoch_done_event_data = (struct cam_isp_hw_epoch_event_data *)evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "invalid event data"); return -EINVAL; } ctx_isp->frame_id_meta = epoch_done_event_data->frame_id_meta; if (list_empty(&ctx->wait_req_list)) { /* * If no wait req in epoch, this is an error case. Loading Loading @@ -1426,10 +1445,19 @@ static int __cam_isp_ctx_buf_done_in_bubble( static int __cam_isp_ctx_epoch_in_bubble_applied( struct cam_isp_context *ctx_isp, void *evt_data) { uint64_t request_id = 0; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; struct cam_context *ctx = ctx_isp->base; uint64_t request_id = 0; struct cam_isp_hw_epoch_event_data *epoch_done_event_data = (struct cam_isp_hw_epoch_event_data *)evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "invalid event data"); return -EINVAL; } ctx_isp->frame_id_meta = epoch_done_event_data->frame_id_meta; /* * This means we missed the reg upd ack. So we need to Loading drivers/cam_isp/cam_isp_context.h +24 −21 Original line number Diff line number Diff line Loading @@ -218,6 +218,8 @@ struct cam_isp_context_event_record { * * @base: Common context object pointer * @frame_id: Frame id tracking for the isp context * @frame_id_meta: Frame id read every epoch for the ctx * meta from the sensor * @substate_actiavted: Current substate for the activated state. * @process_bubble: Atomic variable to check if ctx is still * processing bubble. Loading Loading @@ -252,7 +254,8 @@ struct cam_isp_context { struct cam_context *base; int64_t frame_id; enum cam_isp_ctx_activated_substate substate_activated; uint32_t frame_id_meta; uint32_t substate_activated; atomic_t process_bubble; uint32_t bubble_frame_cnt; struct cam_ctx_ops *substate_machine; Loading drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +29 −19 Original line number Diff line number Diff line Loading @@ -4769,10 +4769,13 @@ static int cam_isp_blob_core_cfg_update( list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { clk_rate = 0; if (!hw_mgr_res->hw_res[i] || hw_mgr_res->res_id != CAM_ISP_HW_VFE_IN_CAMIF) if (!hw_mgr_res->hw_res[i]) continue; if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF) || (hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB)) { hw_intf = hw_mgr_res->hw_res[i]->hw_intf; if (hw_intf && hw_intf->hw_ops.process_cmd) { vfe_core_config.node_res = Loading @@ -4780,21 +4783,25 @@ static int cam_isp_blob_core_cfg_update( memcpy(&vfe_core_config.core_config, core_config, sizeof(struct cam_isp_core_config)); sizeof( struct cam_isp_core_config)); rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_CORE_CONFIG, &vfe_core_config, sizeof( struct cam_vfe_core_config_args)); struct cam_vfe_core_config_args) ); if (rc) CAM_ERR(CAM_ISP, "Core cfg parse fail"); CAM_ERR(CAM_ISP, "Core cfg parse fail"); } else { CAM_WARN(CAM_ISP, "NULL hw_intf!"); } } } } return rc; } Loading Loading @@ -6520,6 +6527,9 @@ static int cam_ife_hw_mgr_handle_hw_epoch( if (!rc) { if (atomic_read(&ife_hw_mgr_ctx->overflow_pending)) break; epoch_done_event_data.frame_id_meta = event_info->th_reg_val; ife_hw_irq_epoch_cb(ife_hw_mgr_ctx->common.cb_priv, CAM_ISP_HW_EVENT_EPOCH, &epoch_done_event_data); } Loading drivers/cam_isp/isp_hw_mgr/include/cam_isp_hw_mgr_intf.h +2 −1 Original line number Diff line number Diff line Loading @@ -170,10 +170,11 @@ struct cam_isp_hw_reg_update_event_data { * struct cam_isp_hw_epoch_event_data - Event payload for CAM_HW_EVENT_EPOCH * * @timestamp: Time stamp for the epoch event * * @frame_id_meta: Frame id value corresponding to this frame */ struct cam_isp_hw_epoch_event_data { uint64_t timestamp; uint32_t frame_id_meta; }; /** Loading drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_isp_hw.h +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ struct cam_isp_resource_node { * @res_id: Unique resource ID * @hw_idx: IFE hw index * @err_type: Error type if any * @th_reg_val: Any critical register value captured during th * */ struct cam_isp_hw_event_info { Loading @@ -184,6 +185,7 @@ struct cam_isp_hw_event_info { uint32_t res_id; uint32_t hw_idx; uint32_t err_type; uint32_t th_reg_val; }; /* Loading Loading
drivers/cam_isp/cam_isp_context.c +36 −8 Original line number Diff line number Diff line Loading @@ -629,6 +629,7 @@ static void __cam_isp_ctx_send_sof_boot_timestamp( req_msg.u.frame_msg.timestamp = ctx_isp->boot_timestamp; req_msg.u.frame_msg.link_hdl = ctx_isp->base->link_hdl; req_msg.u.frame_msg.sof_status = sof_event_status; req_msg.u.frame_msg.frame_id_meta = ctx_isp->frame_id_meta; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld boot time stamp:0x%llx", Loading Loading @@ -656,6 +657,7 @@ static void __cam_isp_ctx_send_sof_timestamp( req_msg.u.frame_msg.timestamp = ctx_isp->sof_timestamp_val; req_msg.u.frame_msg.link_hdl = ctx_isp->base->link_hdl; req_msg.u.frame_msg.sof_status = sof_event_status; req_msg.u.frame_msg.frame_id_meta = ctx_isp->frame_id_meta; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld SOF time stamp:0x%llx", Loading Loading @@ -1040,11 +1042,20 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( struct cam_isp_context *ctx_isp, void *evt_data) { int rc = 0; uint64_t request_id = 0; struct cam_req_mgr_trigger_notify notify; struct cam_context *ctx = ctx_isp->base; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; uint64_t request_id = 0; struct cam_isp_hw_epoch_event_data *epoch_done_event_data = (struct cam_isp_hw_epoch_event_data *)evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "invalid event data"); return -EINVAL; } ctx_isp->frame_id_meta = epoch_done_event_data->frame_id_meta; /* * notify reqmgr with sof signal. Note, due to scheduling delay Loading Loading @@ -1261,11 +1272,19 @@ static int __cam_isp_ctx_reg_upd_in_sof(struct cam_isp_context *ctx_isp, static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, void *evt_data) { uint64_t request_id = 0; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; struct cam_context *ctx = ctx_isp->base; uint64_t request_id = 0; struct cam_isp_hw_epoch_event_data *epoch_done_event_data = (struct cam_isp_hw_epoch_event_data *)evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "invalid event data"); return -EINVAL; } ctx_isp->frame_id_meta = epoch_done_event_data->frame_id_meta; if (list_empty(&ctx->wait_req_list)) { /* * If no wait req in epoch, this is an error case. Loading Loading @@ -1426,10 +1445,19 @@ static int __cam_isp_ctx_buf_done_in_bubble( static int __cam_isp_ctx_epoch_in_bubble_applied( struct cam_isp_context *ctx_isp, void *evt_data) { uint64_t request_id = 0; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; struct cam_context *ctx = ctx_isp->base; uint64_t request_id = 0; struct cam_isp_hw_epoch_event_data *epoch_done_event_data = (struct cam_isp_hw_epoch_event_data *)evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "invalid event data"); return -EINVAL; } ctx_isp->frame_id_meta = epoch_done_event_data->frame_id_meta; /* * This means we missed the reg upd ack. So we need to Loading
drivers/cam_isp/cam_isp_context.h +24 −21 Original line number Diff line number Diff line Loading @@ -218,6 +218,8 @@ struct cam_isp_context_event_record { * * @base: Common context object pointer * @frame_id: Frame id tracking for the isp context * @frame_id_meta: Frame id read every epoch for the ctx * meta from the sensor * @substate_actiavted: Current substate for the activated state. * @process_bubble: Atomic variable to check if ctx is still * processing bubble. Loading Loading @@ -252,7 +254,8 @@ struct cam_isp_context { struct cam_context *base; int64_t frame_id; enum cam_isp_ctx_activated_substate substate_activated; uint32_t frame_id_meta; uint32_t substate_activated; atomic_t process_bubble; uint32_t bubble_frame_cnt; struct cam_ctx_ops *substate_machine; Loading
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +29 −19 Original line number Diff line number Diff line Loading @@ -4769,10 +4769,13 @@ static int cam_isp_blob_core_cfg_update( list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { clk_rate = 0; if (!hw_mgr_res->hw_res[i] || hw_mgr_res->res_id != CAM_ISP_HW_VFE_IN_CAMIF) if (!hw_mgr_res->hw_res[i]) continue; if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF) || (hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB)) { hw_intf = hw_mgr_res->hw_res[i]->hw_intf; if (hw_intf && hw_intf->hw_ops.process_cmd) { vfe_core_config.node_res = Loading @@ -4780,21 +4783,25 @@ static int cam_isp_blob_core_cfg_update( memcpy(&vfe_core_config.core_config, core_config, sizeof(struct cam_isp_core_config)); sizeof( struct cam_isp_core_config)); rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, CAM_ISP_HW_CMD_CORE_CONFIG, &vfe_core_config, sizeof( struct cam_vfe_core_config_args)); struct cam_vfe_core_config_args) ); if (rc) CAM_ERR(CAM_ISP, "Core cfg parse fail"); CAM_ERR(CAM_ISP, "Core cfg parse fail"); } else { CAM_WARN(CAM_ISP, "NULL hw_intf!"); } } } } return rc; } Loading Loading @@ -6520,6 +6527,9 @@ static int cam_ife_hw_mgr_handle_hw_epoch( if (!rc) { if (atomic_read(&ife_hw_mgr_ctx->overflow_pending)) break; epoch_done_event_data.frame_id_meta = event_info->th_reg_val; ife_hw_irq_epoch_cb(ife_hw_mgr_ctx->common.cb_priv, CAM_ISP_HW_EVENT_EPOCH, &epoch_done_event_data); } Loading
drivers/cam_isp/isp_hw_mgr/include/cam_isp_hw_mgr_intf.h +2 −1 Original line number Diff line number Diff line Loading @@ -170,10 +170,11 @@ struct cam_isp_hw_reg_update_event_data { * struct cam_isp_hw_epoch_event_data - Event payload for CAM_HW_EVENT_EPOCH * * @timestamp: Time stamp for the epoch event * * @frame_id_meta: Frame id value corresponding to this frame */ struct cam_isp_hw_epoch_event_data { uint64_t timestamp; uint32_t frame_id_meta; }; /** Loading
drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_isp_hw.h +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ struct cam_isp_resource_node { * @res_id: Unique resource ID * @hw_idx: IFE hw index * @err_type: Error type if any * @th_reg_val: Any critical register value captured during th * */ struct cam_isp_hw_event_info { Loading @@ -184,6 +185,7 @@ struct cam_isp_hw_event_info { uint32_t res_id; uint32_t hw_idx; uint32_t err_type; uint32_t th_reg_val; }; /* Loading