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

Commit 49ddcc71 authored by Harsh Shah's avatar Harsh Shah
Browse files

msm: camera: isp: Self-Issue reg_update to avoid dependency



In case of last pixel stream off, camif is disabled. In this case
issue the reg update command from isp driver, instead of depending on
the userspace to avoid stream off timeout issues.

Change-Id: If6d3bc254518a065f25813191f5748b3cbc4f4d3
Signed-off-by: default avatarHarsh Shah <harshs@codeaurora.org>
parent 95314eae
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -393,9 +393,15 @@ struct msm_vfe_axi_composite_info {
	uint32_t stream_composite_mask;
	uint32_t stream_composite_mask;
};
};


enum msm_vfe_camif_state {
	CAMIF_STOPPED,
	CAMIF_ENABLE,
	CAMIF_DISABLE,
	CAMIF_STOPPING,
};

struct msm_vfe_src_info {
struct msm_vfe_src_info {
	uint32_t frame_id;
	uint32_t frame_id;
	uint32_t camif_sof_frame_id;
	uint32_t reg_update_frame_id;
	uint32_t reg_update_frame_id;
	uint8_t active;
	uint8_t active;
	uint8_t pix_stream_count;
	uint8_t pix_stream_count;
@@ -446,6 +452,7 @@ struct msm_vfe_axi_shared_data {
	uint16_t stream_handle_cnt;
	uint16_t stream_handle_cnt;
	uint32_t event_mask;
	uint32_t event_mask;
	uint8_t enable_frameid_recovery;
	uint8_t enable_frameid_recovery;
	enum msm_vfe_camif_state camif_state;
};
};


struct msm_vfe_stats_hardware_info {
struct msm_vfe_stats_hardware_info {
+0 −6
Original line number Original line Diff line number Diff line
@@ -408,12 +408,6 @@ static void msm_vfe32_process_camif_irq(struct vfe_device *vfe_dev,
	if (!(irq_status0 & 0x1F))
	if (!(irq_status0 & 0x1F))
		return;
		return;


	if (irq_status0 & 0x1)
		vfe_dev->axi_data.src_info[VFE_PIX_0].camif_sof_frame_id++;

	if (vfe_dev->axi_data.src_info[VFE_PIX_0].camif_sof_frame_id == 0)
		vfe_dev->axi_data.src_info[VFE_PIX_0].camif_sof_frame_id = 1;

	if (irq_status0 & BIT(0)) {
	if (irq_status0 & BIT(0)) {
		ISP_DBG("%s: SOF IRQ\n", __func__);
		ISP_DBG("%s: SOF IRQ\n", __func__);
		if (vfe_dev->axi_data.src_info[VFE_PIX_0].raw_stream_count > 0
		if (vfe_dev->axi_data.src_info[VFE_PIX_0].raw_stream_count > 0
+6 −0
Original line number Original line Diff line number Diff line
@@ -681,6 +681,10 @@ static void msm_vfe40_process_reg_update(struct vfe_device *vfe_dev,
				if (atomic_read(
				if (atomic_read(
					&vfe_dev->stats_data.stats_update))
					&vfe_dev->stats_data.stats_update))
					msm_isp_stats_stream_update(vfe_dev);
					msm_isp_stats_stream_update(vfe_dev);
				if (vfe_dev->axi_data.camif_state ==
					CAMIF_STOPPING)
					vfe_dev->hw_info->vfe_ops.core_ops.
						reg_update(vfe_dev, i);
				break;
				break;
			case VFE_RAW_0:
			case VFE_RAW_0:
			case VFE_RAW_1:
			case VFE_RAW_1:
@@ -757,6 +761,8 @@ static void msm_vfe40_reg_update(struct vfe_device *vfe_dev,
		msm_camera_io_w_mb(update_mask,
		msm_camera_io_w_mb(update_mask,
			vfe_dev->vfe_base + 0x378);
			vfe_dev->vfe_base + 0x378);
	} else if (!vfe_dev->is_split ||
	} else if (!vfe_dev->is_split ||
		((frame_src == VFE_PIX_0) &&
		(vfe_dev->axi_data.camif_state == CAMIF_STOPPING)) ||
		(frame_src >= VFE_RAW_0 && frame_src <= VFE_SRC_MAX)) {
		(frame_src >= VFE_RAW_0 && frame_src <= VFE_SRC_MAX)) {
		msm_camera_io_w_mb(update_mask,
		msm_camera_io_w_mb(update_mask,
			vfe_dev->vfe_base + 0x378);
			vfe_dev->vfe_base + 0x378);
+6 −0
Original line number Original line Diff line number Diff line
@@ -525,6 +525,10 @@ static void msm_vfe44_process_reg_update(struct vfe_device *vfe_dev,
				if (atomic_read(
				if (atomic_read(
					&vfe_dev->stats_data.stats_update))
					&vfe_dev->stats_data.stats_update))
					msm_isp_stats_stream_update(vfe_dev);
					msm_isp_stats_stream_update(vfe_dev);
				if (vfe_dev->axi_data.camif_state ==
					CAMIF_STOPPING)
					vfe_dev->hw_info->vfe_ops.core_ops.
						reg_update(vfe_dev, i);
				break;
				break;
			case VFE_RAW_0:
			case VFE_RAW_0:
			case VFE_RAW_1:
			case VFE_RAW_1:
@@ -626,6 +630,8 @@ static void msm_vfe44_reg_update(struct vfe_device *vfe_dev,
		msm_camera_io_w_mb(update_mask,
		msm_camera_io_w_mb(update_mask,
			vfe_dev->vfe_base + 0x378);
			vfe_dev->vfe_base + 0x378);
	} else if (!vfe_dev->is_split ||
	} else if (!vfe_dev->is_split ||
		((frame_src == VFE_PIX_0) &&
		(vfe_dev->axi_data.camif_state == CAMIF_STOPPING)) ||
		(frame_src >= VFE_RAW_0 && frame_src <= VFE_SRC_MAX)) {
		(frame_src >= VFE_RAW_0 && frame_src <= VFE_SRC_MAX)) {
		msm_camera_io_w_mb(update_mask,
		msm_camera_io_w_mb(update_mask,
			vfe_dev->vfe_base + 0x378);
			vfe_dev->vfe_base + 0x378);
+6 −0
Original line number Original line Diff line number Diff line
@@ -455,6 +455,10 @@ static void msm_vfe46_process_reg_update(struct vfe_device *vfe_dev,
				if (atomic_read(
				if (atomic_read(
					&vfe_dev->stats_data.stats_update))
					&vfe_dev->stats_data.stats_update))
					msm_isp_stats_stream_update(vfe_dev);
					msm_isp_stats_stream_update(vfe_dev);
				if (vfe_dev->axi_data.camif_state ==
					CAMIF_STOPPING)
					vfe_dev->hw_info->vfe_ops.core_ops.
						reg_update(vfe_dev, i);
				break;
				break;
			case VFE_RAW_0:
			case VFE_RAW_0:
			case VFE_RAW_1:
			case VFE_RAW_1:
@@ -555,6 +559,8 @@ static void msm_vfe46_reg_update(struct vfe_device *vfe_dev,
		msm_camera_io_w_mb(update_mask,
		msm_camera_io_w_mb(update_mask,
			vfe_dev->vfe_base + 0x3D8);
			vfe_dev->vfe_base + 0x3D8);
	} else if (!vfe_dev->is_split ||
	} else if (!vfe_dev->is_split ||
		((frame_src == VFE_PIX_0) &&
		(vfe_dev->axi_data.camif_state == CAMIF_STOPPING)) ||
		(frame_src >= VFE_RAW_0 && frame_src <= VFE_SRC_MAX)) {
		(frame_src >= VFE_RAW_0 && frame_src <= VFE_SRC_MAX)) {
		msm_camera_io_w_mb(update_mask,
		msm_camera_io_w_mb(update_mask,
			vfe_dev->vfe_base + 0x3D8);
			vfe_dev->vfe_base + 0x3D8);
Loading