From 647861d3442f833b96720335ef85a6ca8908073f Mon Sep 17 00:00:00 2001 From: Depeng Shao Date: Fri, 29 Jan 2021 15:40:47 +0800 Subject: [PATCH] msm: camera: isp: Get the first active req during bubble Sometimes, UMD reports nonincrementing shutter request id issue during monkey test on sHDR usecase, isp reports last one req in active req list during bubble, so if the active req count is 2, we will meet this issue. This change gets the first active req during bubble in case the active req cnt is 2. CRs-Fixed: 2885087 Change-Id: I67d1ecfe9c88123e6d0887383961bfc676455a0d Signed-off-by: Depeng Shao --- drivers/cam_isp/cam_isp_context.c | 36 +++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/drivers/cam_isp/cam_isp_context.c b/drivers/cam_isp/cam_isp_context.c index d4ba000210aa..2ab653a7e77e 100644 --- a/drivers/cam_isp/cam_isp_context.c +++ b/drivers/cam_isp/cam_isp_context.c @@ -1993,6 +1993,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, { bool rc = false; uint64_t request_id = 0; + uint32_t sof_event_status = CAM_REQ_MGR_SOF_EVENT_SUCCESS; struct cam_req_mgr_trigger_notify notify; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; @@ -2100,15 +2101,36 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, CAM_DBG(CAM_REQ, "move request %lld to active list(cnt = %d), ctx %u", req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); - if ((req->request_id > ctx_isp->reported_req_id) - && !req_isp->bubble_report) { - request_id = req->request_id; - ctx_isp->reported_req_id = request_id; - } - __cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id, - CAM_REQ_MGR_SOF_EVENT_ERROR); + /* + * Update the record before req pointer to + * other invalid req. + */ __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_EPOCH, req); + + /* + * Get the req again from active_req_list in case + * the active req cnt is 2. + */ + list_for_each_entry(req, &ctx->active_req_list, list) { + req_isp = (struct cam_isp_ctx_req *) req->req_priv; + if ((!req_isp->bubble_report) && + (req->request_id > ctx_isp->reported_req_id)) { + request_id = req->request_id; + ctx_isp->reported_req_id = request_id; + CAM_DBG(CAM_ISP, + "ctx %d reported_req_id update to %lld", + ctx->ctx_id, ctx_isp->reported_req_id); + break; + } + } + + if ((request_id != 0) && req_isp->bubble_detected) + sof_event_status = CAM_REQ_MGR_SOF_EVENT_ERROR; + + __cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id, + sof_event_status); + ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_BUBBLE; CAM_DBG(CAM_ISP, "next Substate[%s]", __cam_isp_ctx_substate_val_to_type(