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

Commit 70729ccd authored by Megha Tak's avatar Megha Tak
Browse files

msm-camera: Adding lock and unlock methods for


ISP subdev

Added lock mechanism to lock hardware update
when a sof is received, and ignore any other sof
which is received between the update process

Change-Id: If2013a566be0c45a48bf180aa6e16bd5f03cff3c
Signed-off-by: default avatarMegha Tak <mtak@codeaurora.org>
parent 65c7182d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -326,6 +326,7 @@ struct msm_vfe_src_info {
	uint32_t width;
	long pixel_clock;
	uint32_t input_format;/*V4L2 pix format with bayer pattern*/
	uint32_t last_updt_frm_id;
};

enum msm_wm_ub_cfg_type {
+28 −1
Original line number Diff line number Diff line
@@ -881,6 +881,33 @@ static int msm_isp_send_hw_cmd(struct vfe_device *vfe_dev,
		}
		break;
	}
	case VFE_HW_UPDATE_LOCK: {
		uint32_t update_id =
			vfe_dev->axi_data.src_info[VFE_PIX_0].last_updt_frm_id;
		if (vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id != *cfg_data
			|| update_id == *cfg_data) {
			pr_err("hw update lock failed,acquire id %u\n",
				*cfg_data);
			pr_err("hw update lock failed,current id %u\n",
				vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id);
			pr_err("hw update lock failed,last id %u\n",
				update_id);
			return -EINVAL;
		}
		break;
	}
	case VFE_HW_UPDATE_UNLOCK: {
		if (vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id
			!= *cfg_data) {
			pr_err("hw update across frame boundary,begin id %u\n",
				*cfg_data);
			pr_err("hw update across frame boundary,end id %u\n",
				vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id);
			vfe_dev->axi_data.src_info[VFE_PIX_0].last_updt_frm_id =
			vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id;
		}
		break;
	}
	case VFE_READ: {
		int i;
		uint32_t *data_ptr = cfg_data +
@@ -979,7 +1006,7 @@ int msm_isp_proc_cmd(struct vfe_device *vfe_dev, void *arg)
	}

	for (i = 0; i < proc_cmd->num_cfg; i++)
		msm_isp_send_hw_cmd(vfe_dev, &reg_cfg_cmd[i],
		rc = msm_isp_send_hw_cmd(vfe_dev, &reg_cfg_cmd[i],
			cfg_data, proc_cmd->cmd_len);

	if (copy_to_user(proc_cmd->cfg_data,
+2 −0
Original line number Diff line number Diff line
@@ -269,6 +269,8 @@ enum msm_vfe_reg_cfg_type {
	VFE_READ_DMI_64BIT,
	GET_MAX_CLK_RATE,
	GET_ISP_ID,
	VFE_HW_UPDATE_LOCK,
	VFE_HW_UPDATE_UNLOCK,
};

struct msm_vfe_cfg_cmd2 {