From 6f9f6f4854211a1de0997672d5e961851d6d9d19 Mon Sep 17 00:00:00 2001 From: Depeng Shao Date: Mon, 26 Apr 2021 15:44:42 +0800 Subject: [PATCH] msm: camera: reqmgr: Only do self-correction at SOF Since the SOF timestamp is only updated at SOF, so we can't do self-correction at EOF. When the frames already in sync, but the req is a EOF triggered req, then the req can't be applied at SOF, but it will fail to pass self-correction checking at EOF. Then we will loop this progress, the req can't be applied anymore. CRs-Fixed: 2930497 Change-Id: I079cbd3cb9ac9541f049c5369baeee831f7444a2 Signed-off-by: Depeng Shao --- drivers/cam_req_mgr/cam_req_mgr_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/cam_req_mgr/cam_req_mgr_core.c b/drivers/cam_req_mgr/cam_req_mgr_core.c index 0bd68d76fa68..c7d6e8252b02 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_core.c +++ b/drivers/cam_req_mgr/cam_req_mgr_core.c @@ -1339,7 +1339,8 @@ static int __cam_req_mgr_check_sync_for_mslave( static int __cam_req_mgr_check_sync_req_is_ready( struct cam_req_mgr_core_link *link, struct cam_req_mgr_core_link *sync_link, - struct cam_req_mgr_slot *slot) + struct cam_req_mgr_slot *slot, + uint32_t trigger) { struct cam_req_mgr_slot *sync_rd_slot = NULL; int64_t req_id = 0, sync_req_id = 0; @@ -1513,7 +1514,8 @@ static int __cam_req_mgr_check_sync_req_is_ready( */ master_slave_diff = sync_frame_duration; do_div(master_slave_diff, 5); - if ((sync_link->sof_timestamp > 0) && + if ((trigger == CAM_TRIGGER_POINT_SOF) && + (sync_link->sof_timestamp > 0) && (sof_timestamp_delta < master_slave_diff) && (sync_rd_slot->sync_mode == CAM_REQ_MGR_SYNC_MODE_SYNC)) { @@ -1574,7 +1576,8 @@ static int __cam_req_mgr_check_multi_sync_link_ready( } if (link->max_delay == link->sync_link[i]->max_delay) { rc = __cam_req_mgr_check_sync_req_is_ready( - link, link->sync_link[i], slot); + link, link->sync_link[i], + slot, trigger); if (rc < 0) { CAM_DBG(CAM_CRM, "link %x not ready", link->link_hdl);