Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +30 −8 Original line number Diff line number Diff line Loading @@ -571,21 +571,24 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( static void __cam_isp_ctx_send_sof_boot_timestamp( struct cam_isp_context *ctx_isp, uint64_t request_id, uint32_t sof_event_status) uint32_t sof_event_status, uint64_t delta_ts) { struct cam_req_mgr_message req_msg; req_msg.session_hdl = ctx_isp->base->session_hdl; req_msg.u.frame_msg.frame_id = ctx_isp->frame_id; req_msg.u.frame_msg.request_id = request_id; 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.timestamp = ctx_isp->prev_boot_timestamp + delta_ts; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld boot time stamp:0x%llx", "req id:%lld frame num:%lld bt_ts:0x%llx pre_bt_ts:0x%llx diff:0x%llx", request_id, ctx_isp->frame_id, ctx_isp->boot_timestamp); ctx_isp->boot_timestamp, ctx_isp->prev_boot_timestamp, delta_ts); if (cam_req_mgr_notify_message(&req_msg, V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS, Loading @@ -593,6 +596,8 @@ static void __cam_isp_ctx_send_sof_boot_timestamp( CAM_ERR(CAM_ISP, "Error in notifying the boot time for req id:%lld", request_id); ctx_isp->prev_boot_timestamp = req_msg.u.frame_msg.timestamp; } Loading @@ -601,6 +606,7 @@ static void __cam_isp_ctx_send_sof_timestamp( uint32_t sof_event_status) { struct cam_req_mgr_message req_msg; uint64_t delta_ts; req_msg.session_hdl = ctx_isp->base->session_hdl; req_msg.u.frame_msg.frame_id = ctx_isp->frame_id; Loading @@ -610,9 +616,9 @@ static void __cam_isp_ctx_send_sof_timestamp( req_msg.u.frame_msg.sof_status = sof_event_status; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld SOF time stamp:0x%llx", "request id:%lld frame number:%lld SOF time stamp:0x%llx, Prev SOF time:0x%llx", request_id, ctx_isp->frame_id, ctx_isp->sof_timestamp_val); ctx_isp->sof_timestamp_val, ctx_isp->prev_sof_timestamp_val); CAM_DBG(CAM_ISP, "sof status:%d", sof_event_status); if (cam_req_mgr_notify_message(&req_msg, Loading @@ -620,9 +626,17 @@ static void __cam_isp_ctx_send_sof_timestamp( CAM_ERR(CAM_ISP, "Error in notifying the sof time for req id:%lld", request_id); delta_ts = ctx_isp->sof_timestamp_val - ctx_isp->prev_sof_timestamp_val; __cam_isp_ctx_send_sof_boot_timestamp(ctx_isp, request_id, sof_event_status); request_id, sof_event_status, (ctx_isp->prev_sof_timestamp_val == 0) ? ctx_isp->boot_timestamp : delta_ts); ctx_isp->prev_sof_timestamp_val = ctx_isp->sof_timestamp_val; } Loading Loading @@ -703,6 +717,7 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld ctx %u", Loading Loading @@ -1335,6 +1350,7 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -1512,6 +1528,7 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -2100,6 +2117,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_top_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -2291,6 +2309,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -2361,6 +2380,7 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -3383,6 +3403,8 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( ctx_isp->req_info.last_applied_time_stamp = 0; ctx_isp->req_info.last_bufdone_time_stamp = 0; ctx_isp->req_info.last_reported_id_time_stamp = 0; ctx_isp->prev_sof_timestamp_val = 0; ctx_isp->prev_boot_timestamp = 0; atomic_set(&ctx_isp->process_bubble, 0); Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.h +4 −0 Original line number Diff line number Diff line Loading @@ -165,7 +165,9 @@ struct cam_isp_context_req_id_info { * @req_isp: ISP private request object storage * @hw_ctx: HW object returned by the acquire device command * @sof_timestamp_val: Captured time stamp value at sof hw event * @prev_sof_timestamp_val Holds last notified sof time stamp * @boot_timestamp: Boot time stamp for a given req_id * @prev_boot_timestamp Holds last notified boot time stamp * @active_req_cnt: Counter for the active request * @subscribe_event: The irq event mask that CRM subscribes to, IFE * will invoke CRM cb at those event. Loading Loading @@ -194,7 +196,9 @@ struct cam_isp_context { void *hw_ctx; uint64_t sof_timestamp_val; uint64_t prev_sof_timestamp_val; uint64_t boot_timestamp; uint64_t prev_boot_timestamp; int32_t active_req_cnt; uint32_t subscribe_event; atomic64_t state_monitor_head; Loading drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +31 −32 Original line number Diff line number Diff line Loading @@ -4261,7 +4261,8 @@ static int cam_ife_mgr_cmd_get_sof_timestamp( struct cam_hw_intf *hw_intf; struct cam_csid_get_time_stamp_args csid_get_time; list_for_each_entry(hw_mgr_res, &ife_ctx->res_list_ife_csid, list) { hw_mgr_res = list_first_entry(&ife_ctx->res_list_ife_csid, struct cam_ife_hw_mgr_res, list); for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { if (!hw_mgr_res->hw_res[i]) continue; Loading Loading @@ -4298,8 +4299,6 @@ static int cam_ife_mgr_cmd_get_sof_timestamp( } } } } if (rc) CAM_ERR(CAM_ISP, "Getting sof time stamp failed"); Loading drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +13 −3 Original line number Diff line number Diff line Loading @@ -467,6 +467,7 @@ static int cam_ife_csid_global_reset(struct cam_ife_csid_hw *csid_hw) CAM_ERR(CAM_ISP, "CSID:%d IRQ value after reset rc = %d", csid_hw->hw_intf->hw_idx, val); csid_hw->error_irq_count = 0; csid_hw->first_sof_ts = 0; for (i = 0 ; i < CAM_IFE_PIX_PATH_RES_MAX; i++) csid_hw->res_sof_cnt[i] = 0; Loading Loading @@ -1168,6 +1169,7 @@ static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw) csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN; csid_hw->error_irq_count = 0; csid_hw->first_sof_ts = 0; return rc; } Loading Loading @@ -2455,9 +2457,16 @@ static int cam_ife_csid_get_time_stamp( CAM_IFE_CSID_QTIMER_MUL_FACTOR, CAM_IFE_CSID_QTIMER_DIV_FACTOR); if (!csid_hw->first_sof_ts) { get_monotonic_boottime64(&ts); time_stamp->boot_timestamp = (uint64_t)((ts.tv_sec * 1000000000) + time_stamp->boot_timestamp = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); CAM_DBG(CAM_ISP, "timestamp:%lld", time_stamp->boot_timestamp); csid_hw->first_sof_ts = 1; } else time_stamp->boot_timestamp = 0; return 0; } Loading Loading @@ -3739,6 +3748,7 @@ int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf, ife_csid_hw->csid_debug = 0; ife_csid_hw->error_irq_count = 0; ife_csid_hw->first_sof_ts = 0; return 0; err: Loading drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h +2 −0 Original line number Diff line number Diff line Loading @@ -480,6 +480,7 @@ struct cam_ife_csid_path_cfg { * @init_frame_drop Initial frame drop number * @res_sof_cnt path resource sof count value. it used for initial * frame drop * @first_sof_ts flag to mark the first sof has been registered * */ struct cam_ife_csid_hw { Loading Loading @@ -511,6 +512,7 @@ struct cam_ife_csid_hw { uint32_t dual_usage; uint32_t init_frame_drop; uint32_t res_sof_cnt[CAM_IFE_PIX_PATH_RES_MAX]; uint32_t first_sof_ts; }; int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf, Loading Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +30 −8 Original line number Diff line number Diff line Loading @@ -571,21 +571,24 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( static void __cam_isp_ctx_send_sof_boot_timestamp( struct cam_isp_context *ctx_isp, uint64_t request_id, uint32_t sof_event_status) uint32_t sof_event_status, uint64_t delta_ts) { struct cam_req_mgr_message req_msg; req_msg.session_hdl = ctx_isp->base->session_hdl; req_msg.u.frame_msg.frame_id = ctx_isp->frame_id; req_msg.u.frame_msg.request_id = request_id; 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.timestamp = ctx_isp->prev_boot_timestamp + delta_ts; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld boot time stamp:0x%llx", "req id:%lld frame num:%lld bt_ts:0x%llx pre_bt_ts:0x%llx diff:0x%llx", request_id, ctx_isp->frame_id, ctx_isp->boot_timestamp); ctx_isp->boot_timestamp, ctx_isp->prev_boot_timestamp, delta_ts); if (cam_req_mgr_notify_message(&req_msg, V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS, Loading @@ -593,6 +596,8 @@ static void __cam_isp_ctx_send_sof_boot_timestamp( CAM_ERR(CAM_ISP, "Error in notifying the boot time for req id:%lld", request_id); ctx_isp->prev_boot_timestamp = req_msg.u.frame_msg.timestamp; } Loading @@ -601,6 +606,7 @@ static void __cam_isp_ctx_send_sof_timestamp( uint32_t sof_event_status) { struct cam_req_mgr_message req_msg; uint64_t delta_ts; req_msg.session_hdl = ctx_isp->base->session_hdl; req_msg.u.frame_msg.frame_id = ctx_isp->frame_id; Loading @@ -610,9 +616,9 @@ static void __cam_isp_ctx_send_sof_timestamp( req_msg.u.frame_msg.sof_status = sof_event_status; CAM_DBG(CAM_ISP, "request id:%lld frame number:%lld SOF time stamp:0x%llx", "request id:%lld frame number:%lld SOF time stamp:0x%llx, Prev SOF time:0x%llx", request_id, ctx_isp->frame_id, ctx_isp->sof_timestamp_val); ctx_isp->sof_timestamp_val, ctx_isp->prev_sof_timestamp_val); CAM_DBG(CAM_ISP, "sof status:%d", sof_event_status); if (cam_req_mgr_notify_message(&req_msg, Loading @@ -620,9 +626,17 @@ static void __cam_isp_ctx_send_sof_timestamp( CAM_ERR(CAM_ISP, "Error in notifying the sof time for req id:%lld", request_id); delta_ts = ctx_isp->sof_timestamp_val - ctx_isp->prev_sof_timestamp_val; __cam_isp_ctx_send_sof_boot_timestamp(ctx_isp, request_id, sof_event_status); request_id, sof_event_status, (ctx_isp->prev_sof_timestamp_val == 0) ? ctx_isp->boot_timestamp : delta_ts); ctx_isp->prev_sof_timestamp_val = ctx_isp->sof_timestamp_val; } Loading Loading @@ -703,6 +717,7 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld ctx %u", Loading Loading @@ -1335,6 +1350,7 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -1512,6 +1528,7 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -2100,6 +2117,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_top_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -2291,6 +2309,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -2361,6 +2380,7 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld", Loading Loading @@ -3383,6 +3403,8 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( ctx_isp->req_info.last_applied_time_stamp = 0; ctx_isp->req_info.last_bufdone_time_stamp = 0; ctx_isp->req_info.last_reported_id_time_stamp = 0; ctx_isp->prev_sof_timestamp_val = 0; ctx_isp->prev_boot_timestamp = 0; atomic_set(&ctx_isp->process_bubble, 0); Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.h +4 −0 Original line number Diff line number Diff line Loading @@ -165,7 +165,9 @@ struct cam_isp_context_req_id_info { * @req_isp: ISP private request object storage * @hw_ctx: HW object returned by the acquire device command * @sof_timestamp_val: Captured time stamp value at sof hw event * @prev_sof_timestamp_val Holds last notified sof time stamp * @boot_timestamp: Boot time stamp for a given req_id * @prev_boot_timestamp Holds last notified boot time stamp * @active_req_cnt: Counter for the active request * @subscribe_event: The irq event mask that CRM subscribes to, IFE * will invoke CRM cb at those event. Loading Loading @@ -194,7 +196,9 @@ struct cam_isp_context { void *hw_ctx; uint64_t sof_timestamp_val; uint64_t prev_sof_timestamp_val; uint64_t boot_timestamp; uint64_t prev_boot_timestamp; int32_t active_req_cnt; uint32_t subscribe_event; atomic64_t state_monitor_head; Loading
drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +31 −32 Original line number Diff line number Diff line Loading @@ -4261,7 +4261,8 @@ static int cam_ife_mgr_cmd_get_sof_timestamp( struct cam_hw_intf *hw_intf; struct cam_csid_get_time_stamp_args csid_get_time; list_for_each_entry(hw_mgr_res, &ife_ctx->res_list_ife_csid, list) { hw_mgr_res = list_first_entry(&ife_ctx->res_list_ife_csid, struct cam_ife_hw_mgr_res, list); for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { if (!hw_mgr_res->hw_res[i]) continue; Loading Loading @@ -4298,8 +4299,6 @@ static int cam_ife_mgr_cmd_get_sof_timestamp( } } } } if (rc) CAM_ERR(CAM_ISP, "Getting sof time stamp failed"); Loading
drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +13 −3 Original line number Diff line number Diff line Loading @@ -467,6 +467,7 @@ static int cam_ife_csid_global_reset(struct cam_ife_csid_hw *csid_hw) CAM_ERR(CAM_ISP, "CSID:%d IRQ value after reset rc = %d", csid_hw->hw_intf->hw_idx, val); csid_hw->error_irq_count = 0; csid_hw->first_sof_ts = 0; for (i = 0 ; i < CAM_IFE_PIX_PATH_RES_MAX; i++) csid_hw->res_sof_cnt[i] = 0; Loading Loading @@ -1168,6 +1169,7 @@ static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw) csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN; csid_hw->error_irq_count = 0; csid_hw->first_sof_ts = 0; return rc; } Loading Loading @@ -2455,9 +2457,16 @@ static int cam_ife_csid_get_time_stamp( CAM_IFE_CSID_QTIMER_MUL_FACTOR, CAM_IFE_CSID_QTIMER_DIV_FACTOR); if (!csid_hw->first_sof_ts) { get_monotonic_boottime64(&ts); time_stamp->boot_timestamp = (uint64_t)((ts.tv_sec * 1000000000) + time_stamp->boot_timestamp = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); CAM_DBG(CAM_ISP, "timestamp:%lld", time_stamp->boot_timestamp); csid_hw->first_sof_ts = 1; } else time_stamp->boot_timestamp = 0; return 0; } Loading Loading @@ -3739,6 +3748,7 @@ int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf, ife_csid_hw->csid_debug = 0; ife_csid_hw->error_irq_count = 0; ife_csid_hw->first_sof_ts = 0; return 0; err: Loading
drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h +2 −0 Original line number Diff line number Diff line Loading @@ -480,6 +480,7 @@ struct cam_ife_csid_path_cfg { * @init_frame_drop Initial frame drop number * @res_sof_cnt path resource sof count value. it used for initial * frame drop * @first_sof_ts flag to mark the first sof has been registered * */ struct cam_ife_csid_hw { Loading Loading @@ -511,6 +512,7 @@ struct cam_ife_csid_hw { uint32_t dual_usage; uint32_t init_frame_drop; uint32_t res_sof_cnt[CAM_IFE_PIX_PATH_RES_MAX]; uint32_t first_sof_ts; }; int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf, Loading