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

Commit 8078b503 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: reqmgr: Move trace event post applying"

parents 6615cf4e e7d60cd6
Loading
Loading
Loading
Loading
+21 −4
Original line number Original line Diff line number Diff line
@@ -492,8 +492,6 @@ static int __cam_req_mgr_send_req(struct cam_req_mgr_core_link *link,
				continue;
				continue;
			}
			}


			trace_cam_req_mgr_apply_request(link, &apply_req, dev);

			apply_req.trigger_point = trigger;
			apply_req.trigger_point = trigger;
			CAM_DBG(CAM_REQ,
			CAM_DBG(CAM_REQ,
				"SEND: link_hdl: %x pd %d req_id %lld",
				"SEND: link_hdl: %x pd %d req_id %lld",
@@ -506,6 +504,7 @@ static int __cam_req_mgr_send_req(struct cam_req_mgr_core_link *link,
				if (pd == link->max_delay)
				if (pd == link->max_delay)
					link->open_req_cnt--;
					link->open_req_cnt--;
			}
			}
			trace_cam_req_mgr_apply_request(link, &apply_req, dev);
		}
		}
	}
	}
	if (rc < 0) {
	if (rc < 0) {
@@ -637,7 +636,7 @@ static int __cam_req_mgr_check_sync_for_mslave(
{
{
	struct cam_req_mgr_core_link *sync_link = NULL;
	struct cam_req_mgr_core_link *sync_link = NULL;
	struct cam_req_mgr_slot      *sync_slot = NULL;
	struct cam_req_mgr_slot      *sync_slot = NULL;
	int sync_slot_idx = 0, prev_idx, next_idx, rd_idx, rc = 0;
	int sync_slot_idx = 0, prev_idx, next_idx, rd_idx, sync_rd_idx, rc = 0;
	int64_t req_id = 0, sync_req_id = 0;
	int64_t req_id = 0, sync_req_id = 0;


	if (!link->sync_link) {
	if (!link->sync_link) {
@@ -647,6 +646,7 @@ static int __cam_req_mgr_check_sync_for_mslave(


	sync_link = link->sync_link;
	sync_link = link->sync_link;
	req_id = slot->req_id;
	req_id = slot->req_id;
	sync_rd_idx = sync_link->req.in_q->rd_idx;


	CAM_DBG(CAM_CRM,
	CAM_DBG(CAM_CRM,
		"link_hdl %x req %lld frame_skip_flag %d open_req_cnt:%d initial_sync_req [%lld,%lld] is_master:%d",
		"link_hdl %x req %lld frame_skip_flag %d open_req_cnt:%d initial_sync_req [%lld,%lld] is_master:%d",
@@ -663,6 +663,19 @@ static int __cam_req_mgr_check_sync_for_mslave(
		return -EAGAIN;
		return -EAGAIN;
	}
	}


	if (link->in_msync_mode &&
		sync_link->in_msync_mode &&
		(req_id - sync_link->req.in_q->slot[sync_rd_idx].req_id >
		link->max_delay - sync_link->max_delay)) {
		CAM_DBG(CAM_CRM,
			"Req: %lld on link:%x need to hold for link: %x req:%d",
			req_id,
			link->link_hdl,
			sync_link->link_hdl,
			sync_link->req.in_q->slot[sync_rd_idx].req_id);
		return -EINVAL;
	}

	if (link->is_master) {
	if (link->is_master) {
		rc = __cam_req_mgr_inject_delay(link->req.l_tbl, slot->idx);
		rc = __cam_req_mgr_inject_delay(link->req.l_tbl, slot->idx);
		if (rc) {
		if (rc) {
@@ -1001,8 +1014,10 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
					link->link_hdl);
					link->link_hdl);
				link->in_msync_mode = false;
				link->in_msync_mode = false;
				link->initial_sync_req = -1;
				link->initial_sync_req = -1;
				if (link->sync_link)
				if (link->sync_link) {
					link->sync_link->initial_sync_req = -1;
					link->sync_link->initial_sync_req = -1;
					link->sync_link->in_msync_mode = false;
				}
			}
			}


			rc = __cam_req_mgr_inject_delay(link->req.l_tbl,
			rc = __cam_req_mgr_inject_delay(link->req.l_tbl,
@@ -1755,6 +1770,8 @@ int cam_req_mgr_process_sched_req(void *priv, void *data)
			link->initial_sync_req = slot->req_id;
			link->initial_sync_req = slot->req_id;
	} else {
	} else {
		link->initial_sync_req = -1;
		link->initial_sync_req = -1;
		if (link->sync_link)
			link->sync_link->initial_sync_req = -1;
	}
	}


	mutex_unlock(&link->req.lock);
	mutex_unlock(&link->req.lock);