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

Commit 25f35fb3 authored by Ramesh V's avatar Ramesh V Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Fix frame ID jump in dualcam



In B+M there is no guarantee in order for B first
then M,if order reverse then we see frame id jump
to fix this, reset frameid when isp decide
master/slave.

Change-Id: Ic403fdc93af1157e00f024a9cacb375de1ee4d7e
Signed-off-by: default avatarRamesh V <ramev@codeaurora.org>
parent 1d2e9200
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, 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
@@ -822,11 +822,10 @@ void msm_isp_increment_frame_id(struct vfe_device *vfe_dev,
	uint32_t sof_incr = 0;
	unsigned long flags;

	spin_lock_irqsave(&vfe_dev->common_data->common_dev_data_lock, flags);
	if (vfe_dev->axi_data.src_info[frame_src].frame_id == 0)
		msm_isp_update_dual_HW_ms_info_at_start(vfe_dev, frame_src,
			ts);

	spin_lock_irqsave(&vfe_dev->common_data->common_dev_data_lock, flags);
	dual_hw_type =
		vfe_dev->axi_data.src_info[frame_src].dual_hw_type;
	ms_type =
@@ -2530,7 +2529,6 @@ static int msm_isp_update_dual_HW_ms_info_at_start(
	struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data;
	struct msm_vfe_src_info *src_info = NULL;
	uint32_t vfe_id = 0;
	unsigned long flags;

	if (stream_src >= VFE_SRC_MAX) {
		pr_err("%s: Error! Invalid src %u\n", __func__, stream_src);
@@ -2541,12 +2539,9 @@ static int msm_isp_update_dual_HW_ms_info_at_start(
	if (src_info->dual_hw_type != DUAL_HW_MASTER_SLAVE)
		return rc;

	spin_lock_irqsave(&vfe_dev->common_data->common_dev_data_lock, flags);
	if (src_info->dual_hw_ms_info.dual_hw_ms_type ==
		MS_TYPE_MASTER) {
		if (vfe_dev->common_data->ms_resource.master_active == 1) {
			spin_unlock_irqrestore(&vfe_dev->common_data->
				common_dev_data_lock, flags);
			return rc;
		}

@@ -2559,8 +2554,6 @@ static int msm_isp_update_dual_HW_ms_info_at_start(
		 * without repeating.
		 */
		if (!vfe_dev->common_data->ms_resource.slave_active_mask) {
			spin_unlock_irqrestore(&vfe_dev->common_data->
				common_dev_data_lock, flags);
			return rc;
		}
		cur_timestamp_ms = ts->buf_time.tv_sec * 1000 +
@@ -2612,9 +2605,6 @@ static int msm_isp_update_dual_HW_ms_info_at_start(
				(1 << slave_id);
		}
	}
	spin_unlock_irqrestore(&vfe_dev->common_data->common_dev_data_lock,
		flags);

	return rc;
}

+5 −0
Original line number Diff line number Diff line
@@ -566,6 +566,11 @@ static int msm_isp_set_dual_HW_master_slave_mode(
	}

	/* No lock needed here since ioctl lock protects 2 session from race */
	/* Reset master SOF which refer slave in increment_frame_id function */
	vfe_dev->common_data->ms_resource.master_sof_info.frame_id = 0;
	vfe_dev->common_data->ms_resource.master_sof_info.mono_timestamp_ms = 0;
	/* Reset slave frame_id so that master will not jump */
	vfe_dev->common_data->ms_resource.slave_sof_info[0].frame_id = 0;
	if (src_info != NULL &&
		dual_hw_ms_cmd->dual_hw_ms_type == MS_TYPE_MASTER) {
		src_info->dual_hw_type = DUAL_HW_MASTER_SLAVE;