Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +92 −4 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -896,6 +896,29 @@ 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; 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 @@ -967,6 +990,17 @@ 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 @@ -1170,6 +1204,24 @@ 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; 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); CAM_DBG(CAM_ISP, "Flush request in state %d", ctx->state); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); 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 @@ -1230,12 +1282,24 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* HW ERROR */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* HALT */ { .ioctl_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 @@ -1601,10 +1665,23 @@ static struct cam_isp_ctx_irq_ops __cam_isp_ctx_buf_done_in_bubble_applied, }, }, /* HW ERROR */ { }, /* 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 @@ -1660,15 +1737,26 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* HW ERROR */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* HALT */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* FLUSHED */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, }; /* top level state machine */ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, struct cam_release_dev_cmd *cmd) Loading Loading @@ -2343,7 +2431,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_top_state, .flush_req = __cam_isp_ctx_flush_req_in_activated, }, .irq_ops = __cam_isp_ctx_handle_irq_in_activated, }, Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.h +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -52,6 +52,7 @@ 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 @@ -116,6 +117,7 @@ struct cam_isp_ctx_req { * @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 * */ struct cam_isp_context { Loading @@ -135,6 +137,7 @@ struct cam_isp_context { int64_t reported_req_id; uint32_t subscribe_event; int64_t last_applied_req_id; uint32_t frame_skip_count; }; /** Loading Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +92 −4 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -896,6 +896,29 @@ 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; 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 @@ -967,6 +990,17 @@ 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 @@ -1170,6 +1204,24 @@ 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; 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); CAM_DBG(CAM_ISP, "Flush request in state %d", ctx->state); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); 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 @@ -1230,12 +1282,24 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* HW ERROR */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* HALT */ { .ioctl_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 @@ -1601,10 +1665,23 @@ static struct cam_isp_ctx_irq_ops __cam_isp_ctx_buf_done_in_bubble_applied, }, }, /* HW ERROR */ { }, /* 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 @@ -1660,15 +1737,26 @@ static struct cam_ctx_ops .crm_ops = {}, .irq_ops = NULL, }, /* HW ERROR */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* HALT */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* FLUSHED */ { .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, }; /* top level state machine */ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, struct cam_release_dev_cmd *cmd) Loading Loading @@ -2343,7 +2431,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_top_state, .flush_req = __cam_isp_ctx_flush_req_in_activated, }, .irq_ops = __cam_isp_ctx_handle_irq_in_activated, }, Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.h +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -52,6 +52,7 @@ 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 @@ -116,6 +117,7 @@ struct cam_isp_ctx_req { * @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 * */ struct cam_isp_context { Loading @@ -135,6 +137,7 @@ struct cam_isp_context { int64_t reported_req_id; uint32_t subscribe_event; int64_t last_applied_req_id; uint32_t frame_skip_count; }; /** Loading