diff options
author | Chandan Gera <cgera@codeaurora.org> | 2019-04-02 12:06:37 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-06-28 03:17:05 -0700 |
commit | 6e9b5cb31d3c3ef0fb0da8ef66b53fc662c4cc18 (patch) | |
tree | c153e87f080fcc15e7dad3ad43fc5d8f69e2ae58 | |
parent | 927d2a0ae6ea431364630e2c992d2821a8142383 (diff) |
msm:camera: Add Support for Multiple SOF sourcesLA.UM.6.8.1.r3-00400-QCS605.0
Sensor can stream frames uisng different VC/DT combination
and generating multiple SOFs. Currently in CRM multiple SOFs
are not supported so to handle this case we need to combine
these SOFs and send single SOF to work queue.
Change-Id: Iffc7e899aaa69a4e9c80f1956f2b3746cd86ddbe
Signed-off-by: Chandan Gera <cgera@codeaurora.org>
-rw-r--r-- | drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c | 28 | ||||
-rw-r--r-- | drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.h | 14 |
2 files changed, 40 insertions, 2 deletions
diff --git a/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c b/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c index 8de297db8ff7..617cf6a4585d 100644 --- a/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c +++ b/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2018,2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2073,6 +2073,8 @@ static int cam_req_mgr_cb_notify_trigger( struct cam_req_mgr_core_link *link = NULL; struct cam_req_mgr_trigger_notify *notify_trigger; struct crm_task_payload *task_data; + bool send_sof = true; + int i = 0; if (!trigger_data) { CAM_ERR(CAM_CRM, "sof_data is NULL"); @@ -2087,6 +2089,24 @@ static int cam_req_mgr_cb_notify_trigger( rc = -EINVAL; goto end; } + for (i = 0; i < link->num_sof_src; i++) { + if (link->dev_sof_evt[i].dev_hdl == trigger_data->dev_hdl) { + if (link->dev_sof_evt[i].sof_done == false) + link->dev_sof_evt[i].sof_done = true; + else + CAM_DBG(CAM_CRM, "Received Surious SOF"); + + } else if (link->dev_sof_evt[i].sof_done == false) { + send_sof = false; + } + + } + + if (!send_sof) + return 0; + + for (i = 0; i < link->num_sof_src; i++) + link->dev_sof_evt[i].sof_done = false; spin_lock_bh(&link->link_state_spin_lock); if (link->state < CAM_CRM_LINK_STATE_READY) { @@ -2199,6 +2219,12 @@ static int __cam_req_mgr_setup_link_info(struct cam_req_mgr_core_link *link, subscribe_event |= (uint32_t)dev->dev_info.trigger; } + if (dev->dev_info.dev_id == CAM_REQ_MGR_DEVICE_IFE) { + link->dev_sof_evt[link->num_sof_src].dev_hdl = + dev->dev_hdl; + link->dev_sof_evt[link->num_sof_src].sof_done = false; + link->num_sof_src++; + } } link->subscribe_event = subscribe_event; diff --git a/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.h b/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.h index 8b86931cd1e3..cac4113d124e 100644 --- a/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.h +++ b/drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2018,2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -275,6 +275,16 @@ struct cam_req_mgr_connected_device { void *parent; }; +/* * + * struct cam_req_mgr_ife_sof_evt + * - Track SOF Events from IFE + * @ dev_hdl : device handle + * @ sof_done : tracks sof for individual IFE + */ +struct cam_req_mgr_dev_sof_evt { + int32_t dev_hdl; + bool sof_done; +}; /** * struct cam_req_mgr_core_link * - Link Properties @@ -334,6 +344,8 @@ struct cam_req_mgr_core_link { bool frame_skip_flag; bool sync_link_sof_skip; int32_t open_req_cnt; + int32_t num_sof_src; + struct cam_req_mgr_dev_sof_evt dev_sof_evt[3]; }; /** |