瀏覽代碼

msm: camera: isp: Update substate prior to notifying CRM

When a bubble is detected ISP notifies CRM either for recovery or
provides a trigger to apply next req. Due to scheduling issues,
it's possible that CRM triggers an apply prior to ISP substate update
leading to apply failures. This could prove fatal in case of
FS/sHDR use-cases. This change updates the substate prior to
notifying CRM.

CRs-Fixed: 2841729
Change-Id: I5ccc2b91f347ec29a5dcf6aafe71c063572a7ff7
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 4 年之前
父節點
當前提交
671fbda8c2
共有 1 個文件被更改,包括 7 次插入5 次删除
  1. 7 5
      drivers/cam_isp/cam_isp_context.c

+ 7 - 5
drivers/cam_isp/cam_isp_context.c

@@ -2024,6 +2024,9 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
 		goto end;
 		goto end;
 	}
 	}
 
 
+	/* Update state prior to notifying CRM */
+	ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_BUBBLE;
+
 	req = list_first_entry(&ctx->wait_req_list, struct cam_ctx_request,
 	req = list_first_entry(&ctx->wait_req_list, struct cam_ctx_request,
 		list);
 		list);
 	req_isp = (struct cam_isp_ctx_req *)req->req_priv;
 	req_isp = (struct cam_isp_ctx_req *)req->req_priv;
@@ -2118,11 +2121,6 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
 	__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
 	__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
 		sof_event_status);
 		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(
-		ctx_isp->substate_activated));
-
 	cam_req_mgr_debug_delay_detect();
 	cam_req_mgr_debug_delay_detect();
 	trace_cam_delay_detect("ISP",
 	trace_cam_delay_detect("ISP",
 		"bubble epoch_in_applied", req->request_id,
 		"bubble epoch_in_applied", req->request_id,
@@ -2138,6 +2136,10 @@ end:
 		__cam_isp_ctx_update_state_monitor_array(ctx_isp,
 		__cam_isp_ctx_update_state_monitor_array(ctx_isp,
 			CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH, request_id);
 			CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH, request_id);
 	}
 	}
+
+	CAM_DBG(CAM_ISP, "next Substate[%s]",
+		__cam_isp_ctx_substate_val_to_type(
+		ctx_isp->substate_activated));
 	return 0;
 	return 0;
 }
 }