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

Commit b2f70ae2 authored by Sreesudhan Ramakrish Ramkumar's avatar Sreesudhan Ramakrish Ramkumar Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: isp: Handle axi stream off failure



In case axi stream off fails, we do a disable write master and
a reg update. The error needs to be propagated to user space
after we ensure reg update succeeds. Hence, when stream off fails,
we wait for config done and then proagate the error to user space.

Change-Id: I7ad01ae77a8ec2e8eae529fec64935b6de5c31c0
Signed-off-by: default avatarSreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
parent cd2c69a8
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -1382,7 +1382,8 @@ static int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev)
}

static int msm_isp_axi_wait_for_cfg_done(struct vfe_device *vfe_dev,
	enum msm_isp_camif_update_state camif_update, uint32_t src_mask)
	enum msm_isp_camif_update_state camif_update,
	uint32_t src_mask, int regUpdateCnt)
{
	int rc;
	unsigned long flags;
@@ -1391,7 +1392,7 @@ static int msm_isp_axi_wait_for_cfg_done(struct vfe_device *vfe_dev,

	for (i = 0; i < VFE_SRC_MAX; i++) {
		if (src_mask & (1 << i))
			vfe_dev->axi_data.stream_update[i] = 2;
			vfe_dev->axi_data.stream_update[i] = regUpdateCnt;
	}
	if (src_mask) {
		init_completion(&vfe_dev->stream_config_complete);
@@ -1699,7 +1700,7 @@ static int msm_isp_start_axi_stream(struct vfe_device *vfe_dev,

	if (wait_for_complete) {
		rc = msm_isp_axi_wait_for_cfg_done(vfe_dev, camif_update,
			src_mask);
			src_mask, 2);
		if (rc < 0)
			pr_err("%s: wait for config done failed\n", __func__);
	}
@@ -1770,20 +1771,24 @@ static int msm_isp_stop_axi_stream(struct vfe_device *vfe_dev,

	if (src_mask) {
		rc = msm_isp_axi_wait_for_cfg_done(vfe_dev, camif_update,
			src_mask);
			src_mask, 2);
		if (rc < 0) {
			pr_err("%s: wait for config done failed\n", __func__);
			for (i = 0; i < stream_cfg_cmd->num_streams; i++) {
				stream_info = &axi_data->stream_info[
				HANDLE_TO_IDX(
					stream_cfg_cmd->stream_handle[i])];
				stream_info->state = STOP_PENDING;
				stream_info->state = STOPPING;
				msm_isp_axi_stream_enable_cfg(
					vfe_dev, stream_info);
				vfe_dev->hw_info->vfe_ops.core_ops.reg_update(
					vfe_dev,
					SRC_TO_INTF(stream_info->stream_src));
				stream_info->state = INACTIVE;
				rc = msm_isp_axi_wait_for_cfg_done(vfe_dev,
					camif_update, src_mask, 1);
				if (rc < 0)
					pr_err("cfg done failed\n");
				rc = -EBUSY;
			}
		}
	}
@@ -2117,7 +2122,7 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
				stream_info->state = UPDATING;
				rc = msm_isp_axi_wait_for_cfg_done(vfe_dev,
					NO_UPDATE, (1 << SRC_TO_INTF(
					stream_info->stream_src)));
					stream_info->stream_src)), 2);
				if (rc < 0)
					pr_err("%s: wait for update failed\n",
						__func__);