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

Commit 18f0b654 authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

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

Merge "msm: camera: reqmgr: Also check the idx if the rd slot has applied" into camera-kernel.lnx.1.0
parents f268f4f4 a467c0e4
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1125,6 +1125,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;
@@ -1228,12 +1229,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);