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

Commit 94344b5a authored by Peter Liu's avatar Peter Liu Committed by Shubhraprakash Das
Browse files

msm: camera: isp: use single vfe dev to send event



Use single thread to send event to avoid race condition
between 2 userspace polling thread.

Change-Id: I2645ebd73a97dbe7c873579a425607a53bcb88c6
Signed-off-by: default avatarPeter Liu <pingchie@codeaurora.org>
parent e6c029e4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -485,6 +485,7 @@ static int vfe_probe(struct platform_device *pdev)
		&vfe_dev->axi_data;
	vfe_dev->dual_vfe_res->stats_data[vfe_dev->pdev->id] =
		&vfe_dev->stats_data;
	vfe_dev->dual_vfe_res->vfe_dev[vfe_dev->pdev->id] = vfe_dev;

	rc = vfe_dev->hw_info->vfe_ops.core_ops.get_platform_data(vfe_dev);
	if (rc < 0) {
+1 −0
Original line number Diff line number Diff line
@@ -575,6 +575,7 @@ struct msm_vfe_hw_init_parms {
};

struct dual_vfe_resource {
	struct vfe_device *vfe_dev[MAX_VFE];
	void __iomem *vfe_base[MAX_VFE];
	uint32_t reg_update_mask[MAX_VFE];
	struct msm_vfe_stats_shared_data *stats_data[MAX_VFE];
+16 −4
Original line number Diff line number Diff line
@@ -1382,6 +1382,7 @@ static void msm_isp_process_done_buf(struct vfe_device *vfe_dev,
	uint32_t frame_id;
	uint32_t buf_src;
	uint8_t drop_frame = 0;
	struct msm_isp_bufq *bufq = NULL;
	memset(&buf_event, 0, sizeof(buf_event));

	frame_id = vfe_dev->axi_data.
@@ -1497,13 +1498,24 @@ static void msm_isp_process_done_buf(struct vfe_device *vfe_dev,
			stream_info->runtime_output_format;
		if (stream_info->buf_divert &&
			buf_src != MSM_ISP_BUFFER_SRC_SCRATCH) {
			ISP_DBG(
				"%s: vfe_id %d send buf_divert buf-id %d bufq %x\n",
			ISP_DBG("%s: VFE%d send buf_divert buf id %d Q %x\n",
				__func__, vfe_dev->pdev->id, buf->buf_idx,
				buf->bufq_handle);

			msm_isp_send_event(vfe_dev, ISP_EVENT_BUF_DIVERT,
					&buf_event);
			bufq = vfe_dev->buf_mgr->ops->get_bufq(vfe_dev->buf_mgr,
				buf->bufq_handle);
			if (!bufq) {
				pr_err("%s: Invalid bufq buf_handle %x\n",
					__func__, buf->bufq_handle);
			}

			if ((bufq != NULL) && bufq->buf_type == ISP_SHARE_BUF)
				msm_isp_send_event(vfe_dev->dual_vfe_res->
					vfe_dev[ISP_VFE1],
					ISP_EVENT_BUF_DIVERT, &buf_event);
			else
				msm_isp_send_event(vfe_dev,
				ISP_EVENT_BUF_DIVERT, &buf_event);
		} else {
			ISP_DBG("%s: vfe_id %d send buf done buf-id %d\n",
				__func__, vfe_dev->pdev->id, buf->buf_idx);