Forráskód Böngészése

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 count is 2.

CRs-Fixed: 2885087
Change-Id: I67d1ecfe9c88123e6d0887383961bfc676455a0d
Signed-off-by: Depeng Shao <[email protected]>
Depeng Shao 4 éve
szülő
commit
3042ddc21c
1 módosított fájl, 29 hozzáadás és 7 törlés
  1. 29 7
      drivers/cam_isp/cam_isp_context.c

+ 29 - 7
drivers/cam_isp/cam_isp_context.c

@@ -1992,6 +1992,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
 	void *evt_data)
 	void *evt_data)
 {
 {
 	uint64_t request_id = 0;
 	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_req_mgr_trigger_notify   notify;
 	struct cam_ctx_request             *req;
 	struct cam_ctx_request             *req;
 	struct cam_isp_ctx_req             *req_isp;
 	struct cam_isp_ctx_req             *req_isp;
@@ -2085,15 +2086,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",
 	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);
 		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_update_event_record(ctx_isp,
 		CAM_ISP_CTX_EVENT_EPOCH, req);
 		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;
 	ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_BUBBLE;
 	CAM_DBG(CAM_ISP, "next Substate[%s]",
 	CAM_DBG(CAM_ISP, "next Substate[%s]",
 		__cam_isp_ctx_substate_val_to_type(
 		__cam_isp_ctx_substate_val_to_type(