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

Commit a467c0e4 authored by Depeng Shao's avatar Depeng Shao
Browse files

msm: camera: reqmgr: Also check the idx if the rd slot has applied



- Also check the idx if the rd slot is applied, since the status
is APPLIED before sync link process next frame, there is a big
chance that sync link rd slot is APPLIED if current link is processing
the frame, then CRM won't do the idx checking if we don't check
APPLIED status.

CRs-Fixed: 2615873
Change-Id: I8fa6f004cec536afcfee5774617165bd0480064d
Signed-off-by: default avatarDepeng Shao <depengs@codeaurora.org>
parent e824a782
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1117,6 +1117,7 @@ static int __cam_req_mgr_check_sync_req_is_ready(
	int64_t req_id = 0, sync_req_id = 0;
	int sync_slot_idx = 0, sync_rd_idx = 0, rc = 0;
	int32_t sync_num_slots = 0;
	int32_t max_idx_diff;
	uint64_t sync_frame_duration = 0;
	uint64_t sof_timestamp_delta = 0;
	uint64_t master_slave_diff = 0;
@@ -1220,12 +1221,20 @@ static int __cam_req_mgr_check_sync_req_is_ready(
		return -EAGAIN;
	}

	/*
	 * When the status of sync rd slot is APPLIED,
	 * the maximum diff between sync_slot_idx and
	 * sync_rd_idx is 1, since the next processed
	 * req maybe the request in (sync_rd_idx + 1)th
	 * slot.
	 */
	max_idx_diff =
		(sync_rd_slot->status == CRM_SLOT_STATUS_REQ_APPLIED) ? 1 : 0;

	if ((sync_link->req.in_q->slot[sync_slot_idx].status !=
		CRM_SLOT_STATUS_REQ_APPLIED) &&
		(((sync_slot_idx - sync_rd_idx + sync_num_slots) %
		sync_num_slots) >= 1) &&
		(sync_rd_slot->status !=
		CRM_SLOT_STATUS_REQ_APPLIED)) {
		sync_num_slots) > max_idx_diff)) {
		CAM_DBG(CAM_CRM,
			"Req: %lld [other link] not next req to be applied on link: %x",
			req_id, sync_link->link_hdl);