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

Commit 96091a5d authored by Jing Zhou's avatar Jing Zhou Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: isp: Fix RDI stream streamoff issue



When stop the RDI stream, the wait flag should not be set to true if we
are halting the system. In the new logic, the halt will cause the system
timeout due to ispif might be stopped.
The change will stop the RDI without waiting if the VFE will be halted.

CRs-fixed: 991080
Change-Id: Ia0a7512006c1eeb15deb10b87aaff5668a7b5ef2
Signed-off-by: default avatarJing Zhou <jzhou70@codeaurora.org>
parent 79db14ca
Loading
Loading
Loading
Loading
+27 −41
Original line number Diff line number Diff line
@@ -1902,6 +1902,13 @@ static void msm_isp_get_camif_update_state_and_halt(
			pix_stream_cnt++;
	}

	if (vfe_dev->axi_data.num_active_stream == stream_cfg_cmd->num_streams
		&& (stream_cfg_cmd->cmd == STOP_STREAM ||
		stream_cfg_cmd->cmd == STOP_IMMEDIATELY))
		*halt = 1;
	else
		*halt = 0;

	if ((pix_stream_cnt) &&
		(axi_data->src_info[VFE_PIX_0].input_mux != EXTERNAL_READ)) {
		if (cur_pix_stream_cnt == 0 && pix_stream_cnt &&
@@ -1909,24 +1916,17 @@ static void msm_isp_get_camif_update_state_and_halt(
			*camif_update = ENABLE_CAMIF;
		else if (cur_pix_stream_cnt &&
			(cur_pix_stream_cnt - pix_stream_cnt) == 0 &&
			stream_cfg_cmd->cmd == STOP_STREAM)
			*camif_update = DISABLE_CAMIF;
		else if (cur_pix_stream_cnt &&
			(cur_pix_stream_cnt - pix_stream_cnt) == 0 &&
			stream_cfg_cmd->cmd == STOP_IMMEDIATELY)
			(stream_cfg_cmd->cmd == STOP_STREAM ||
			stream_cfg_cmd->cmd == STOP_IMMEDIATELY)) {
			if (*halt)
				*camif_update = DISABLE_CAMIF_IMMEDIATELY;
			else
				*camif_update = DISABLE_CAMIF;
		}
		else
			*camif_update = NO_UPDATE;
	} else
		*camif_update = NO_UPDATE;

	if (vfe_dev->axi_data.num_active_stream == stream_cfg_cmd->num_streams
		&& (stream_cfg_cmd->cmd == STOP_STREAM ||
		stream_cfg_cmd->cmd == STOP_IMMEDIATELY))
		*halt = 1;
	else
		*halt = 0;

}

static void msm_isp_update_camif_output_count(
@@ -2610,34 +2610,20 @@ static int msm_isp_stop_axi_stream(struct vfe_device *vfe_dev,
		wait_for_complete_for_this_stream = 0;

		stream_info->state = STOP_PENDING;
		ISP_DBG("Stop axi Stream 0x%x\n", stream_info->stream_id);
		if (stream_info->stream_src == CAMIF_RAW ||
			stream_info->stream_src == IDEAL_RAW) {
			/* We dont get reg update IRQ for raw snapshot
			 * so frame skip cant be ocnfigured
			*/
			if ((camif_update != DISABLE_CAMIF_IMMEDIATELY) &&
				(!ext_read))
				wait_for_complete_for_this_stream = 1;

		} else if (stream_info->stream_type == BURST_STREAM &&
				stream_info->runtime_num_burst_capture == 0) {
			/* Configure AXI writemasters to stop immediately
			 * since for burst case, write masters already skip
			 * all frames.
			 */
			if (stream_info->stream_src == RDI_INTF_0 ||
				stream_info->stream_src == RDI_INTF_1 ||
				stream_info->stream_src == RDI_INTF_2)
				wait_for_complete_for_this_stream = 1;
		} else {
			if  ((camif_update != DISABLE_CAMIF_IMMEDIATELY) &&
				!halt && (!ext_read))
		if (!halt && !ext_read &&
			!(stream_info->stream_type == BURST_STREAM &&
			stream_info->runtime_num_burst_capture == 0))
			wait_for_complete_for_this_stream = 1;
		}
		ISP_DBG("%s: vfe_dev %d camif_update %d halt %d wait %d\n",
			__func__, vfe_dev->pdev->id, camif_update, halt,

		ISP_DBG("%s: stream 0x%x, vfe %d camif %d halt %d wait %d\n",
			__func__,
			stream_info->stream_id,
			vfe_dev->pdev->id,
			camif_update,
			halt,
			wait_for_complete_for_this_stream);

		intf = SRC_TO_INTF(stream_info->stream_src);
		if (!wait_for_complete_for_this_stream ||
			stream_info->state == INACTIVE ||