Bläddra i källkod

msm: camera: common: Handle epoch if bubble recovery is disabled

If bubble recovery is disabled, IFE driver should continue
to notify that epoch to CRM as opposed to dropping that frame
in IFE. In case of sHDR if bubble recovery is disabled and IFE
does not notify the epoch at which bubble was detected it will lead
to a trigger count mismatch in CRM.

CRs-Fixed: 2768309
Change-Id: I311ce80857a905496c633708a5f4ee2391679037
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 4 år sedan
förälder
incheckning
d9a20488d8
2 ändrade filer med 51 tillägg och 2 borttagningar
  1. 46 2
      drivers/cam_isp/cam_isp_context.c
  2. 5 0
      drivers/cam_req_mgr/cam_req_mgr_core.c

+ 46 - 2
drivers/cam_isp/cam_isp_context.c

@@ -942,7 +942,7 @@ static int __cam_isp_ctx_handle_buf_done_for_request(
 				CAM_DBG(CAM_ISP, "Sync failed with rc = %d",
 					 rc);
 		} else if (!req_isp->bubble_report) {
-			CAM_ERR(CAM_ISP,
+			CAM_DBG(CAM_ISP,
 				"Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u",
 				req->request_id,
 				req_isp->fence_map_out[j].resource_handle,
@@ -1083,7 +1083,7 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr(
 				CAM_DBG(CAM_ISP, "Sync failed with rc = %d",
 					 rc);
 		} else if (!req_isp->bubble_report) {
-			CAM_ERR(CAM_ISP,
+			CAM_DBG(CAM_ISP,
 				"Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u",
 				req->request_id,
 				req_isp->fence_map_out[j].resource_handle,
@@ -1726,6 +1726,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
 	void *evt_data)
 {
 	uint64_t request_id = 0;
+	struct cam_req_mgr_trigger_notify   notify;
 	struct cam_ctx_request             *req;
 	struct cam_isp_ctx_req             *req_isp;
 	struct cam_context                 *ctx = ctx_isp->base;
@@ -1784,6 +1785,27 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
 		atomic_set(&ctx_isp->process_bubble, 1);
 	} else {
 		req_isp->bubble_report = 0;
+		CAM_DBG(CAM_ISP, "Skip bubble recovery for req %lld ctx %u",
+			req->request_id, ctx->ctx_id);
+		if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_trigger &&
+			ctx_isp->active_req_cnt <= 1) {
+			if (ctx_isp->subscribe_event & CAM_TRIGGER_POINT_SOF) {
+				notify.link_hdl = ctx->link_hdl;
+				notify.dev_hdl = ctx->dev_hdl;
+				notify.frame_id = ctx_isp->frame_id;
+				notify.trigger = CAM_TRIGGER_POINT_SOF;
+				notify.req_id =
+					ctx_isp->req_info.last_bufdone_req_id;
+				notify.sof_timestamp_val =
+					ctx_isp->sof_timestamp_val;
+				notify.trigger_id = ctx_isp->trigger_id;
+
+				ctx->ctx_crm_intf->notify_trigger(&notify);
+				CAM_DBG(CAM_ISP,
+					"Notify CRM  SOF frame %lld ctx %u",
+					ctx_isp->frame_id, ctx->ctx_id);
+			}
+		}
 	}
 
 	/*
@@ -1905,6 +1927,7 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
 	struct cam_isp_context *ctx_isp, void *evt_data)
 {
 	uint64_t  request_id = 0;
+	struct cam_req_mgr_trigger_notify   notify;
 	struct cam_ctx_request             *req;
 	struct cam_isp_ctx_req             *req_isp;
 	struct cam_context                 *ctx = ctx_isp->base;
@@ -1966,6 +1989,27 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
 		atomic_set(&ctx_isp->process_bubble, 1);
 	} else {
 		req_isp->bubble_report = 0;
+		CAM_DBG(CAM_ISP, "Skip bubble recovery for req %lld ctx %u",
+			req->request_id, ctx->ctx_id);
+		if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_trigger &&
+			ctx_isp->active_req_cnt <= 1) {
+			if (ctx_isp->subscribe_event & CAM_TRIGGER_POINT_SOF) {
+				notify.link_hdl = ctx->link_hdl;
+				notify.dev_hdl = ctx->dev_hdl;
+				notify.frame_id = ctx_isp->frame_id;
+				notify.trigger = CAM_TRIGGER_POINT_SOF;
+				notify.req_id =
+					ctx_isp->req_info.last_bufdone_req_id;
+				notify.sof_timestamp_val =
+					ctx_isp->sof_timestamp_val;
+				notify.trigger_id = ctx_isp->trigger_id;
+
+				ctx->ctx_crm_intf->notify_trigger(&notify);
+				CAM_DBG(CAM_ISP,
+					"Notify CRM  SOF frame %lld ctx %u",
+					ctx_isp->frame_id, ctx->ctx_id);
+			}
+		}
 	}
 
 	/*

+ 5 - 0
drivers/cam_req_mgr/cam_req_mgr_core.c

@@ -554,6 +554,8 @@ static void __cam_req_mgr_flush_req_slot(
 	atomic_set(&link->eof_event_cnt, 0);
 	in_q->wr_idx = 0;
 	in_q->rd_idx = 0;
+	link->trigger_cnt[0] = 0;
+	link->trigger_cnt[1] = 0;
 }
 
 /**
@@ -3028,6 +3030,9 @@ static int __cam_req_mgr_check_for_dual_trigger(
 {
 	int rc  = -EAGAIN;
 
+	CAM_DBG(CAM_CRM, "trigger_cnt [%u: %u]",
+		link->trigger_cnt[0], link->trigger_cnt[1]);
+
 	if (link->trigger_cnt[0] == link->trigger_cnt[1]) {
 		link->trigger_cnt[0] = 0;
 		link->trigger_cnt[1] = 0;