Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +13 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,7 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( req_isp->bubble_detected = false; list_del_init(&req->list); list_add(&req->list, &ctx->pending_req_list); atomic_set(&ctx_isp->process_bubble, 0); CAM_DBG(CAM_REQ, "Move active request %lld to pending list(cnt = %d) [bubble recovery]", Loading Loading @@ -765,6 +766,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, notify.req_id = req->request_id; notify.error = CRM_KMD_ERR_BUBBLE; ctx->ctx_crm_intf->notify_err(¬ify); atomic_set(&ctx_isp->process_bubble, 1); CAM_DBG(CAM_ISP, "Notify CRM about Bubble frame %lld", ctx_isp->frame_id); } else { Loading Loading @@ -1198,6 +1200,14 @@ static int __cam_isp_ctx_apply_req_in_activated_state( * */ ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; if (atomic_read(&ctx_isp->process_bubble)) { CAM_ERR_RATE_LIMIT(CAM_ISP, "Processing bubble cannot apply Request Id %llu", apply->request_id); rc = -EAGAIN; goto end; } spin_lock_bh(&ctx->lock); req = list_first_entry(&ctx->pending_req_list, struct cam_ctx_request, list); Loading Loading @@ -1408,6 +1418,7 @@ static int __cam_isp_ctx_flush_req_in_top_state( rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); spin_unlock_bh(&ctx->lock); atomic_set(&ctx_isp->process_bubble, 0); if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) { /* if active and wait list are empty, return */ spin_lock_bh(&ctx->lock); Loading Loading @@ -2450,6 +2461,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, start_isp.hw_config.init_packet = 1; start_isp.start_only = false; atomic_set(&ctx_isp->process_bubble, 0); ctx_isp->frame_id = 0; ctx_isp->active_req_cnt = 0; ctx_isp->reported_req_id = 0; Loading Loading @@ -2585,6 +2597,7 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( ctx_isp->frame_id = 0; ctx_isp->active_req_cnt = 0; ctx_isp->reported_req_id = 0; atomic_set(&ctx_isp->process_bubble, 0); CAM_DBG(CAM_ISP, "Stop device success next state %d on ctx %u", ctx->state, ctx->ctx_id); 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-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -143,6 +143,8 @@ struct cam_isp_context_state_monitor { * @base: Common context object pointer * @frame_id: Frame id tracking for the isp context * @substate_actiavted: Current substate for the activated state. * @process_bubble: Atomic variable to check if ctx is still * processing bubble * @substate_machine: ISP substate machine for external interface * @substate_machine_irq: ISP substate machine for irq handling * @req_base: Common request object storage Loading @@ -166,6 +168,7 @@ struct cam_isp_context { int64_t frame_id; uint32_t substate_activated; atomic_t process_bubble; struct cam_ctx_ops *substate_machine; struct cam_isp_ctx_irq_ops *substate_machine_irq; Loading Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +13 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,7 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( req_isp->bubble_detected = false; list_del_init(&req->list); list_add(&req->list, &ctx->pending_req_list); atomic_set(&ctx_isp->process_bubble, 0); CAM_DBG(CAM_REQ, "Move active request %lld to pending list(cnt = %d) [bubble recovery]", Loading Loading @@ -765,6 +766,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, notify.req_id = req->request_id; notify.error = CRM_KMD_ERR_BUBBLE; ctx->ctx_crm_intf->notify_err(¬ify); atomic_set(&ctx_isp->process_bubble, 1); CAM_DBG(CAM_ISP, "Notify CRM about Bubble frame %lld", ctx_isp->frame_id); } else { Loading Loading @@ -1198,6 +1200,14 @@ static int __cam_isp_ctx_apply_req_in_activated_state( * */ ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; if (atomic_read(&ctx_isp->process_bubble)) { CAM_ERR_RATE_LIMIT(CAM_ISP, "Processing bubble cannot apply Request Id %llu", apply->request_id); rc = -EAGAIN; goto end; } spin_lock_bh(&ctx->lock); req = list_first_entry(&ctx->pending_req_list, struct cam_ctx_request, list); Loading Loading @@ -1408,6 +1418,7 @@ static int __cam_isp_ctx_flush_req_in_top_state( rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); spin_unlock_bh(&ctx->lock); atomic_set(&ctx_isp->process_bubble, 0); if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) { /* if active and wait list are empty, return */ spin_lock_bh(&ctx->lock); Loading Loading @@ -2450,6 +2461,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, start_isp.hw_config.init_packet = 1; start_isp.start_only = false; atomic_set(&ctx_isp->process_bubble, 0); ctx_isp->frame_id = 0; ctx_isp->active_req_cnt = 0; ctx_isp->reported_req_id = 0; Loading Loading @@ -2585,6 +2597,7 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( ctx_isp->frame_id = 0; ctx_isp->active_req_cnt = 0; ctx_isp->reported_req_id = 0; atomic_set(&ctx_isp->process_bubble, 0); CAM_DBG(CAM_ISP, "Stop device success next state %d on ctx %u", ctx->state, ctx->ctx_id); 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-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -143,6 +143,8 @@ struct cam_isp_context_state_monitor { * @base: Common context object pointer * @frame_id: Frame id tracking for the isp context * @substate_actiavted: Current substate for the activated state. * @process_bubble: Atomic variable to check if ctx is still * processing bubble * @substate_machine: ISP substate machine for external interface * @substate_machine_irq: ISP substate machine for irq handling * @req_base: Common request object storage Loading @@ -166,6 +168,7 @@ struct cam_isp_context { int64_t frame_id; uint32_t substate_activated; atomic_t process_bubble; struct cam_ctx_ops *substate_machine; struct cam_isp_ctx_irq_ops *substate_machine_irq; Loading