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

Commit ecd74203 authored by Meera Gande's avatar Meera Gande Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: isp: Handle frame drop due to delay



In few scenarios, the request frame may get
delayed and current and request frame id may
become same. To handle such scenarios, made
changes to inform user to delay a frame and
process the request.

Change-Id: I31fa04c386922c48a043c511a163c76316e21987
Signed-off-by: default avatarMeera Gande <mgande@codeaurora.org>
parent d21f4f8a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ static int isp_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
	struct page *page;
	struct vfe_device *vfe_dev = vma->vm_private_data;
	struct isp_proc *isp_page = NULL;
	struct isp_kstate *isp_page = NULL;

	isp_page = vfe_dev->isp_page;

@@ -728,7 +728,7 @@ int vfe_hw_probe(struct platform_device *pdev)
	vfe_dev->buf_mgr->init_done = 1;
	vfe_dev->vfe_open_cnt = 0;
	/*Allocate a page in kernel and map it to camera user process*/
	vfe_dev->isp_page = (struct isp_proc *)get_zeroed_page(GFP_KERNEL);
	vfe_dev->isp_page = (struct isp_kstate *)get_zeroed_page(GFP_KERNEL);
	if (vfe_dev->isp_page == NULL) {
		pr_err("%s: no enough memory\n", __func__);
		rc = -ENOMEM;
+1 −6
Original line number Diff line number Diff line
@@ -761,11 +761,6 @@ struct msm_vfe_common_subdev {
	struct msm_vfe_common_dev_data *common_data;
};

struct isp_proc {
	uint32_t  kernel_sofid;
	uint32_t  vfeid;
};

struct vfe_device {
	/* Driver private data */
	struct platform_device *pdev;
@@ -850,7 +845,7 @@ struct vfe_device {
	uint32_t recovery_irq1_mask;
	/* total bandwidth per vfe */
	uint64_t total_bandwidth;
	struct isp_proc *isp_page;
	struct isp_kstate *isp_page;
};

struct vfe_parent_device {
+20 −3
Original line number Diff line number Diff line
@@ -3545,6 +3545,14 @@ static int msm_isp_request_frame(struct vfe_device *vfe_dev,
	frame_src = SRC_TO_INTF(stream_info->stream_src);
	pingpong_status = vfe_dev->hw_info->
		vfe_ops.axi_ops.get_pingpong_status(vfe_dev);

	/* As MCT is still processing it, need to drop the additional requests*/
	if (vfe_dev->isp_page->drop_reconfig) {
		pr_err("%s: MCT has not yet delayed %d drop request %d\n",
			__func__, vfe_dev->isp_page->drop_reconfig, frame_id);
		goto error;
	}

	/*
	 * If PIX stream is active then RDI path uses SOF frame ID of PIX
	 * In case of standalone RDI streaming, SOF are used from
@@ -3558,9 +3566,18 @@ static int msm_isp_request_frame(struct vfe_device *vfe_dev,
		vfe_dev->axi_data.src_info[frame_src].accept_frame == false) {
		pr_debug("%s:%d invalid time to request frame %d\n",
			__func__, __LINE__, frame_id);
		goto error;
	}
	if ((vfe_dev->axi_data.src_info[frame_src].active && (frame_id !=
		vfe_dev->isp_page->drop_reconfig = 1;
	} else if ((vfe_dev->axi_data.src_info[frame_src].active) &&
			(frame_id ==
			vfe_dev->axi_data.src_info[frame_src].frame_id) &&
			(stream_info->undelivered_request_cnt <=
				MAX_BUFFERS_IN_HW)) {
		vfe_dev->isp_page->drop_reconfig = 1;
		pr_debug("%s: vfe_%d request_frame %d cur frame id %d pix %d\n",
			__func__, vfe_dev->pdev->id, frame_id,
			vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id,
			vfe_dev->axi_data.src_info[VFE_PIX_0].active);
	} else if ((vfe_dev->axi_data.src_info[frame_src].active && (frame_id !=
		vfe_dev->axi_data.src_info[frame_src].frame_id + vfe_dev->
		axi_data.src_info[frame_src].sof_counter_step)) ||
		((!vfe_dev->axi_data.src_info[frame_src].active))) {
+7 −0
Original line number Diff line number Diff line
@@ -26,9 +26,16 @@
#define ISP_STATS_STREAM_BIT  0x80000000

#define VFE_HW_LIMIT 1
#define ISP_KERNEL_STATE 1

struct msm_vfe_cfg_cmd_list;

struct isp_kstate {
	uint32_t kernel_sofid;
	uint32_t drop_reconfig;
	uint32_t vfeid;
};

enum ISP_START_PIXEL_PATTERN {
	ISP_BAYER_RGRGRG,
	ISP_BAYER_GRGRGR,