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

Commit 75fae4d1 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm-camera: Add SOF Consolidation for SHDRv3.8"

parents 7604502b 260e268e
Loading
Loading
Loading
Loading
+27 −2
Original line number Diff line number Diff line
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2020, 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
@@ -51,6 +51,7 @@ void cam_req_mgr_core_link_reset(struct cam_req_mgr_core_link *link)
	link->initial_skip = true;
	link->sof_timestamp = 0;
	link->prev_sof_timestamp = 0;
	link->num_sof_src = 0;
}

void cam_req_mgr_handle_core_shutdown(void)
@@ -2475,7 +2476,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");
		rc = -EINVAL;
@@ -2489,6 +2491,23 @@ 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) {
@@ -2637,6 +2656,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;
+13 −1
Original line number Diff line number Diff line
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2020, 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
@@ -286,6 +286,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
@@ -358,6 +368,8 @@ struct cam_req_mgr_core_link {
	int64_t                              initial_sync_req;
	uint64_t                             sof_timestamp;
	uint64_t                             prev_sof_timestamp;
	int32_t                              num_sof_src;
	struct cam_req_mgr_dev_sof_evt       dev_sof_evt[3];
};

/**