Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b11f7da authored by Vikram Sharma's avatar Vikram Sharma
Browse files

msm: camera: isp: Handle Delayed Epoch scenario in Dual IFE



In Case of epoch delay don't move the req to free list from active list
Instead deffer the moving of request when we get the epoch.

Change-Id: Ib201914bea04383f5930795b26a8ef2a07989d33
Signed-off-by: default avatarVikram Sharma <vikramsa@codeaurora.org>
parent a4ad2182
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -695,6 +695,16 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(
			ctx_isp->substate_activated);
		__cam_isp_ctx_update_event_record(ctx_isp,
			CAM_ISP_CTX_EVENT_BUFDONE, req);
	} else if (req->request_id > ctx_isp->req_info.reported_req_id) {
		CAM_INFO_RATE_LIMIT(CAM_ISP,
			"Not moving req_id %lld to free list. rep_req %lld",
			req->request_id, ctx_isp->req_info.reported_req_id);
		__cam_isp_ctx_update_state_monitor_array(ctx_isp,
			CAM_ISP_HW_EVENT_DONE,
			ctx_isp->substate_activated,
			ctx_isp->substate_activated);
		__cam_isp_ctx_update_event_record(ctx_isp,
			CAM_ISP_CTX_EVENT_BUFDONE, req);
	} else {
		list_del_init(&req->list);
		list_add_tail(&req->list, &ctx->free_req_list);
@@ -920,6 +930,7 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
	struct cam_context *ctx = ctx_isp->base;
	struct cam_ctx_request  *req = NULL;
	uint64_t  request_id  = 0;
	struct cam_isp_ctx_req  *req_isp = NULL;

	/*
	 * notify reqmgr with sof signal. Note, due to scheduling delay
@@ -946,6 +957,8 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
			if (req->request_id >
				ctx_isp->req_info.reported_req_id) {
				request_id = req->request_id;
				req_isp =
					(struct cam_isp_ctx_req *)req->req_priv;
				ctx_isp->req_info.reported_req_id = request_id;
				ctx_isp->req_info.last_reported_id_time_stamp =
					jiffies_to_msecs(jiffies);
@@ -978,6 +991,14 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
		rc = -EFAULT;
	}

	if ((req_isp) && (req_isp->num_acked == req_isp->num_fence_map_out)) {
		CAM_INFO_RATE_LIMIT(CAM_REQ,
			"Move active req %lld to free [all fences done] ctx %u",
			req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id);
		list_del_init(&req->list);
		list_add_tail(&req->list, &ctx->free_req_list);
	}

	return 0;
}