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

Commit 58637e2f authored by Meera Gande's avatar Meera Gande Committed by Ebrahim Shaik
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>
Signed-off-by: default avatarAbhishek Jain <abhij@codeaurora.org>
parent 8f24df85
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ static int isp_vma_fault(struct vm_fault *vmf)
{
	struct page *page;
	struct vfe_device *vfe_dev = vmf->vma->vm_private_data;
	struct isp_proc *isp_page = NULL;
	struct isp_kstate *isp_page = NULL;

	isp_page = vfe_dev->isp_page;

@@ -743,7 +743,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;
+2 −7
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -771,11 +771,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;
@@ -862,7 +857,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;

	/* Dual VFE IRQ CAMSS Info*/
	void __iomem *camss_base;
+21 −5
Original line number Diff line number Diff line
@@ -3529,8 +3529,15 @@ 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);
		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
@@ -3544,9 +3551,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 −1
Original line number Diff line number Diff line
@@ -27,10 +27,16 @@

#define VFE_HW_LIMIT 1
#define DUAL_ISP_SYNC 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,