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

Commit 07869d3a authored by Abhishek Kondaveeti's avatar Abhishek Kondaveeti Committed by Gerrit - the friendly Code Review server
Browse files

msm: isp: Fix pdaf buffer drop



Use common data accessible to both ISPs to
store pdaf buffer index

Change-Id: I27d33eaa8bc517250503bdb0e9267e94180a99f0
Signed-off-by: default avatarAbhishek Kondaveeti <akondave@codeaurora.org>
parent 5d78c03a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -738,6 +738,7 @@ struct msm_vfe_common_dev_data {
	struct msm_vfe_axi_stream streams[VFE_AXI_SRC_MAX * MAX_VFE];
	struct msm_vfe_stats_stream stats_streams[MSM_ISP_STATS_MAX * MAX_VFE];
	struct mutex vfe_common_mutex;
	uint8_t pd_buf_idx;
	/* Irq debug Info */
	struct msm_vfe_irq_dump vfe_irq_dump;
	struct msm_vfe_tasklet tasklets[MAX_VFE + 1];
@@ -836,8 +837,6 @@ struct vfe_device {
	uint32_t bus_err_ign_mask;
	uint32_t recovery_irq0_mask;
	uint32_t recovery_irq1_mask;
	/* Store the buf_idx for pd stats RDI stream */
	uint8_t pd_buf_idx;
	/* total bandwidth per vfe */
	uint64_t total_bandwidth;
};
+7 −2
Original line number Diff line number Diff line
@@ -995,6 +995,7 @@ static void msm_isp_update_pd_stats_idx(struct vfe_device *vfe_dev,
	uint32_t pingpong_status = 0, pingpong_bit = 0;
	struct msm_isp_buffer *done_buf = NULL;
	int vfe_idx = -1;
	unsigned long flags;

	if (frame_src < VFE_RAW_0 || frame_src >  VFE_RAW_2)
		return;
@@ -1012,10 +1013,14 @@ static void msm_isp_update_pd_stats_idx(struct vfe_device *vfe_dev,
		pingpong_bit = ((pingpong_status >>
			pd_stream_info->wm[vfe_idx][0]) & 0x1);
		done_buf = pd_stream_info->buf[pingpong_bit];
		spin_lock_irqsave(&vfe_dev->common_data->
			common_dev_data_lock, flags);
		if (done_buf)
			vfe_dev->pd_buf_idx = done_buf->buf_idx;
			vfe_dev->common_data->pd_buf_idx = done_buf->buf_idx;
		else
			vfe_dev->pd_buf_idx = 0xF;
			vfe_dev->common_data->pd_buf_idx = 0xF;
		spin_unlock_irqrestore(&vfe_dev->common_data->
			common_dev_data_lock, flags);
	}
}

+6 −2
Original line number Diff line number Diff line
@@ -229,8 +229,12 @@ static int32_t msm_isp_stats_buf_divert(struct vfe_device *vfe_dev,

	stats_event->pd_stats_idx = 0xF;
	if (stream_info->stats_type == MSM_ISP_STATS_BF) {
		stats_event->pd_stats_idx = vfe_dev->pd_buf_idx;
		vfe_dev->pd_buf_idx = 0xF;
		spin_lock_irqsave(&vfe_dev->common_data->
			common_dev_data_lock, flags);
		stats_event->pd_stats_idx = vfe_dev->common_data->pd_buf_idx;
		vfe_dev->common_data->pd_buf_idx = 0xF;
		spin_unlock_irqrestore(&vfe_dev->common_data->
			common_dev_data_lock, flags);
	}
	if (comp_stats_type_mask == NULL) {
		stats_event->stats_mask =
+1 −1
Original line number Diff line number Diff line
@@ -2316,7 +2316,7 @@ int msm_isp_open_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
	/* Register page fault handler */
	vfe_dev->buf_mgr->pagefault_debug_disable = 0;
	/* initialize pd_buf_idx with an invalid index 0xF */
	vfe_dev->pd_buf_idx = 0xF;
	vfe_dev->common_data->pd_buf_idx = 0xF;

	cam_smmu_reg_client_page_fault_handler(
			vfe_dev->buf_mgr->iommu_hdl,