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: Meera Gande <mgande@codeaurora.org>
This commit is contained in:
parent
df805abc50
commit
5bf83ce8c3
4 changed files with 30 additions and 11 deletions
|
@ -467,7 +467,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;
|
||||
|
||||
|
@ -749,7 +749,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;
|
||||
|
|
|
@ -762,11 +762,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;
|
||||
|
@ -851,7 +846,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 {
|
||||
|
|
|
@ -3497,6 +3497,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
|
||||
|
@ -3510,9 +3518,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))) {
|
||||
|
|
|
@ -25,9 +25,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,
|
||||
|
|
Loading…
Add table
Reference in a new issue