Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +11 −85 Original line number Diff line number Diff line Loading @@ -524,11 +524,11 @@ static int __cam_isp_ctx_reg_upd_in_activated_state( struct cam_context *ctx = ctx_isp->base; struct cam_isp_ctx_req *req_isp; if (list_empty(&ctx->pending_req_list)) { CAM_ERR(CAM_ISP, "Reg upd ack with no pending request"); if (list_empty(&ctx->wait_req_list)) { CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request"); goto end; } req = list_first_entry(&ctx->pending_req_list, req = list_first_entry(&ctx->wait_req_list, struct cam_ctx_request, list); list_del_init(&req->list); Loading Loading @@ -1078,30 +1078,6 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, return rc; } static int __cam_isp_ctx_sof_in_flush( struct cam_isp_context *ctx_isp, void *evt_data) { int rc = 0; struct cam_isp_hw_sof_event_data *sof_event_data = evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "in valid sof event data"); return -EINVAL; } ctx_isp->frame_id++; ctx_isp->sof_timestamp_val = sof_event_data->timestamp; ctx_isp->boot_timestamp = sof_event_data->boot_time; CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", ctx_isp->frame_id, ctx_isp->sof_timestamp_val); if (--ctx_isp->frame_skip_count == 0) ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; else CAM_ERR(CAM_ISP, "Skip currect SOF"); return rc; } static struct cam_isp_ctx_irq_ops cam_isp_ctx_activated_state_machine_irq[CAM_ISP_CTX_ACTIVATED_MAX] = { /* SOF */ Loading Loading @@ -1173,17 +1149,6 @@ static struct cam_isp_ctx_irq_ops /* HALT */ { }, /* FLUSH */ { .irq_ops = { NULL, __cam_isp_ctx_sof_in_flush, NULL, NULL, NULL, __cam_isp_ctx_buf_done_in_applied, }, }, }; static int __cam_isp_ctx_apply_req_in_activated_state( Loading Loading @@ -1265,6 +1230,8 @@ static int __cam_isp_ctx_apply_req_in_activated_state( spin_lock_bh(&ctx->lock); ctx_isp->substate_activated = next_state; ctx_isp->last_applied_req_id = apply->request_id; list_del_init(&req->list); list_add_tail(&req->list, &ctx->wait_req_list); CAM_DBG(CAM_ISP, "new substate state %d, applied req %lld", next_state, ctx_isp->last_applied_req_id); spin_unlock_bh(&ctx->lock); Loading Loading @@ -1339,6 +1306,10 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx, INIT_LIST_HEAD(&flush_list); if (list_empty(req_list)) { CAM_DBG(CAM_ISP, "request list is empty"); if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ) { CAM_ERR(CAM_ISP, "no request to cancel"); return -EINVAL; } else return 0; } Loading Loading @@ -1402,28 +1373,6 @@ static int __cam_isp_ctx_flush_req_in_top_state( return rc; } static int __cam_isp_ctx_flush_req_in_activated( struct cam_context *ctx, struct cam_req_mgr_flush_request *flush_req) { int rc = 0; struct cam_isp_context *ctx_isp; ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; CAM_DBG(CAM_ISP, "Flush request in state %d", ctx->state); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); /* only if request is found in pending queue, move to flush state*/ if (!rc) { spin_lock_bh(&ctx->lock); ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_FLUSH; ctx_isp->frame_skip_count = 2; spin_unlock_bh(&ctx->lock); } return rc; } static int __cam_isp_ctx_flush_req_in_ready( struct cam_context *ctx, struct cam_req_mgr_flush_request *flush_req) Loading Loading @@ -1496,12 +1445,6 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* FLUSH */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, }; static int __cam_isp_ctx_rdi_only_sof_in_top_state( Loading Loading @@ -1886,17 +1829,6 @@ static struct cam_isp_ctx_irq_ops /* HALT */ { }, /* FLUSH */ { .irq_ops = { NULL, __cam_isp_ctx_sof_in_flush, NULL, NULL, NULL, __cam_isp_ctx_buf_done_in_applied, }, }, }; static int __cam_isp_ctx_rdi_only_apply_req_top_state( Loading Loading @@ -1964,12 +1896,6 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* FLUSHED */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, }; /* top level state machine */ Loading Loading @@ -2715,7 +2641,7 @@ static struct cam_ctx_ops .crm_ops = { .unlink = __cam_isp_ctx_unlink_in_activated, .apply_req = __cam_isp_ctx_apply_req, .flush_req = __cam_isp_ctx_flush_req_in_activated, .flush_req = __cam_isp_ctx_flush_req_in_top_state, .process_evt = __cam_isp_ctx_process_evt, }, .irq_ops = __cam_isp_ctx_handle_irq_in_activated, Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.h +0 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ enum cam_isp_ctx_activated_substate { CAM_ISP_CTX_ACTIVATED_BUBBLE_APPLIED, CAM_ISP_CTX_ACTIVATED_HW_ERROR, CAM_ISP_CTX_ACTIVATED_HALT, CAM_ISP_CTX_ACTIVATED_FLUSH, CAM_ISP_CTX_ACTIVATED_MAX, }; Loading Loading @@ -155,7 +154,6 @@ struct cam_isp_context_state_monitor { * @subscribe_event: The irq event mask that CRM subscribes to, IFE * will invoke CRM cb at those event. * @last_applied_req_id: Last applied request id * @frame_skip_count: Number of frame to skip before change state * @state_monitor_head: Write index to the state monitoring array * @cam_isp_ctx_state_monitor: State monitoring array * @rdi_only_context: Get context type information. Loading @@ -180,7 +178,6 @@ struct cam_isp_context { int64_t reported_req_id; uint32_t subscribe_event; int64_t last_applied_req_id; uint32_t frame_skip_count; atomic64_t state_monitor_head; struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[ CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES]; Loading Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +11 −85 Original line number Diff line number Diff line Loading @@ -524,11 +524,11 @@ static int __cam_isp_ctx_reg_upd_in_activated_state( struct cam_context *ctx = ctx_isp->base; struct cam_isp_ctx_req *req_isp; if (list_empty(&ctx->pending_req_list)) { CAM_ERR(CAM_ISP, "Reg upd ack with no pending request"); if (list_empty(&ctx->wait_req_list)) { CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request"); goto end; } req = list_first_entry(&ctx->pending_req_list, req = list_first_entry(&ctx->wait_req_list, struct cam_ctx_request, list); list_del_init(&req->list); Loading Loading @@ -1078,30 +1078,6 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, return rc; } static int __cam_isp_ctx_sof_in_flush( struct cam_isp_context *ctx_isp, void *evt_data) { int rc = 0; struct cam_isp_hw_sof_event_data *sof_event_data = evt_data; if (!evt_data) { CAM_ERR(CAM_ISP, "in valid sof event data"); return -EINVAL; } ctx_isp->frame_id++; ctx_isp->sof_timestamp_val = sof_event_data->timestamp; ctx_isp->boot_timestamp = sof_event_data->boot_time; CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", ctx_isp->frame_id, ctx_isp->sof_timestamp_val); if (--ctx_isp->frame_skip_count == 0) ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; else CAM_ERR(CAM_ISP, "Skip currect SOF"); return rc; } static struct cam_isp_ctx_irq_ops cam_isp_ctx_activated_state_machine_irq[CAM_ISP_CTX_ACTIVATED_MAX] = { /* SOF */ Loading Loading @@ -1173,17 +1149,6 @@ static struct cam_isp_ctx_irq_ops /* HALT */ { }, /* FLUSH */ { .irq_ops = { NULL, __cam_isp_ctx_sof_in_flush, NULL, NULL, NULL, __cam_isp_ctx_buf_done_in_applied, }, }, }; static int __cam_isp_ctx_apply_req_in_activated_state( Loading Loading @@ -1265,6 +1230,8 @@ static int __cam_isp_ctx_apply_req_in_activated_state( spin_lock_bh(&ctx->lock); ctx_isp->substate_activated = next_state; ctx_isp->last_applied_req_id = apply->request_id; list_del_init(&req->list); list_add_tail(&req->list, &ctx->wait_req_list); CAM_DBG(CAM_ISP, "new substate state %d, applied req %lld", next_state, ctx_isp->last_applied_req_id); spin_unlock_bh(&ctx->lock); Loading Loading @@ -1339,6 +1306,10 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx, INIT_LIST_HEAD(&flush_list); if (list_empty(req_list)) { CAM_DBG(CAM_ISP, "request list is empty"); if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ) { CAM_ERR(CAM_ISP, "no request to cancel"); return -EINVAL; } else return 0; } Loading Loading @@ -1402,28 +1373,6 @@ static int __cam_isp_ctx_flush_req_in_top_state( return rc; } static int __cam_isp_ctx_flush_req_in_activated( struct cam_context *ctx, struct cam_req_mgr_flush_request *flush_req) { int rc = 0; struct cam_isp_context *ctx_isp; ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; CAM_DBG(CAM_ISP, "Flush request in state %d", ctx->state); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); /* only if request is found in pending queue, move to flush state*/ if (!rc) { spin_lock_bh(&ctx->lock); ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_FLUSH; ctx_isp->frame_skip_count = 2; spin_unlock_bh(&ctx->lock); } return rc; } static int __cam_isp_ctx_flush_req_in_ready( struct cam_context *ctx, struct cam_req_mgr_flush_request *flush_req) Loading Loading @@ -1496,12 +1445,6 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* FLUSH */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, }; static int __cam_isp_ctx_rdi_only_sof_in_top_state( Loading Loading @@ -1886,17 +1829,6 @@ static struct cam_isp_ctx_irq_ops /* HALT */ { }, /* FLUSH */ { .irq_ops = { NULL, __cam_isp_ctx_sof_in_flush, NULL, NULL, NULL, __cam_isp_ctx_buf_done_in_applied, }, }, }; static int __cam_isp_ctx_rdi_only_apply_req_top_state( Loading Loading @@ -1964,12 +1896,6 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* FLUSHED */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, }; /* top level state machine */ Loading Loading @@ -2715,7 +2641,7 @@ static struct cam_ctx_ops .crm_ops = { .unlink = __cam_isp_ctx_unlink_in_activated, .apply_req = __cam_isp_ctx_apply_req, .flush_req = __cam_isp_ctx_flush_req_in_activated, .flush_req = __cam_isp_ctx_flush_req_in_top_state, .process_evt = __cam_isp_ctx_process_evt, }, .irq_ops = __cam_isp_ctx_handle_irq_in_activated, Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.h +0 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ enum cam_isp_ctx_activated_substate { CAM_ISP_CTX_ACTIVATED_BUBBLE_APPLIED, CAM_ISP_CTX_ACTIVATED_HW_ERROR, CAM_ISP_CTX_ACTIVATED_HALT, CAM_ISP_CTX_ACTIVATED_FLUSH, CAM_ISP_CTX_ACTIVATED_MAX, }; Loading Loading @@ -155,7 +154,6 @@ struct cam_isp_context_state_monitor { * @subscribe_event: The irq event mask that CRM subscribes to, IFE * will invoke CRM cb at those event. * @last_applied_req_id: Last applied request id * @frame_skip_count: Number of frame to skip before change state * @state_monitor_head: Write index to the state monitoring array * @cam_isp_ctx_state_monitor: State monitoring array * @rdi_only_context: Get context type information. Loading @@ -180,7 +178,6 @@ struct cam_isp_context { int64_t reported_req_id; uint32_t subscribe_event; int64_t last_applied_req_id; uint32_t frame_skip_count; atomic64_t state_monitor_head; struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[ CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES]; Loading