vdin: revert ignore v4l2start/stop ioctl when vdin1 used for preview [1/1]

PD#SWPL-7324

Problem:
tvafe work abnormal when use vdin1 preview

Solution:
revert the previous commit for v4l2start/stop

Verify:
x301

This reverts commit 81c1e1449c.

Change-Id: I8cdefececb8b01cb86426684a6c700bc9bf8b615
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
This commit is contained in:
Evoke Zhang
2019-04-22 18:30:02 +08:00
committed by Tao Zeng
parent 7b0ef35d93
commit 321d0bc2b0

View File

@@ -88,8 +88,6 @@ static unsigned int tl1_vdin1_canvas_addr;
static unsigned int tl1_vdin1_height;
static unsigned int tl1_vdin1_width;
spinlock_t tl1_preview_lock;
static unsigned int tl1_vdin1_capture_flag;
/*
* canvas_config_mode
* 0: canvas_config in driver probe
@@ -684,13 +682,18 @@ void vdin_start_dec(struct vdin_dev_s *devp)
devp->index, jiffies_to_msecs(jiffies),
jiffies_to_msecs(jiffies)-devp->start_time);
if (devp->afbce_mode == 1) {
if (is_meson_tl1_cpu()) {
if ((devp->afbce_mode == 1) &&
(is_meson_tl1_cpu() || is_meson_tm2_cpu())) {
if ((devp->h_active >= 1920) && (devp->v_active >= 1080)) {
tl1_vdin1_preview_flag = 1;
tl1_vdin1_data_readied = 0;
tl1_vdin1_preview_ready_flag = 0;
pr_info("vdin.%d tl1_vdin1_preview state init\n",
devp->index);
} else {
tl1_vdin1_preview_flag = 0;
vdin_afbc_force_drop_frame =
vdin_afbc_force_drop_frame_cnt;
}
vfe_drop_force = NULL;
max_ignore_frames[devp->index] = max_ignore_frame_cnt;
@@ -820,10 +823,9 @@ int start_tvin_service(int no, struct vdin_parm_s *para)
}
if (tl1_vdin1_preview_flag == 1) {
tl1_vdin1_capture_flag = 1;
pr_info("[vdin]%s vdin%d already enabled for preview.\n",
pr_err("[vdin]%s vdin%d use for preview, return.\n",
__func__, no);
return 0;
return -1;
}
fmt = devp->parm.info.fmt;
if (vdin_dbg_en) {
@@ -959,13 +961,6 @@ int stop_tvin_service(int no)
struct vdin_dev_s *devp;
unsigned int end_time;
if (tl1_vdin1_preview_flag == 1) {
tl1_vdin1_capture_flag = 0;
pr_info("[vdin]%s vdin%d is used for preview.\n",
__func__, no);
return 0;
}
devp = vdin_devp[no];
if ((devp->parm.reserved & PARAM_STATE_HISTGRAM) &&
(devp->parm.reserved & PARAM_STATE_SCREENCAP) &&
@@ -1577,8 +1572,7 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
vdin_vf_disp_mode_update(devp->last_wr_vfe, devp->vfp);
devp->last_wr_vfe = NULL;
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1) &&
(tl1_vdin1_capture_flag == 0)) {
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1)) {
//if (vdin_dbg_en)
//pr_info("vdin1 preview dont notify receiver.\n");
} else {
@@ -1794,8 +1788,7 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
}
}
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1) &&
(tl1_vdin1_capture_flag == 0)) {
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1)) {
//if (vdin_dbg_en)
//pr_info("vdin1 preview dont notify receiver.\n");
} else {
@@ -2002,8 +1995,7 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
if (!(devp->flags&VDIN_FLAG_RDMA_ENABLE) ||
(devp->game_mode & VDIN_GAME_MODE_1)) {
/* not RDMA, or game mode 1 */
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1) &&
(tl1_vdin1_capture_flag == 0)) {
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1)) {
//if (vdin_dbg_en)
//pr_info("vdin1 preview dont notify receiver.\n");
} else {
@@ -2062,8 +2054,7 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
}
spin_unlock_irqrestore(&tl1_preview_lock, flags1);
provider_vf_put(next_wr_vfe, devp->vfp);
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1) &&
(tl1_vdin1_capture_flag == 0)) {
if ((devp->index == 1) && (tl1_vdin1_preview_flag == 1)) {
//if (vdin_dbg_en)
//pr_info("vdin1 preview dont notify receiver.\n");
} else {
@@ -3037,10 +3028,6 @@ static long vdin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
pr_info("TVIN_IOC_S_VDIN_V4L2START cann't be used at vdin0\n");
break;
}
if ((tl1_vdin1_preview_flag) && (devp->index == 1)) {
pr_info("TVIN_IOC_S_VDIN_V4L2START ignore for vdin1 is already enabled\n");
break;
}
if (devp->flags & VDIN_FLAG_ISR_REQ)
free_irq(devp->irq, (void *)devp);
@@ -3082,10 +3069,6 @@ static long vdin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
pr_info("TVIN_IOC_S_VDIN_V4L2STOP cann't be used at vdin0\n");
break;
}
if ((tl1_vdin1_preview_flag) && (devp->index == 1)) {
pr_info("TVIN_IOC_S_VDIN_V4L2STOP ignore for vdin1 used for preview\n");
break;
}
devp->parm.reserved &= ~PARAM_STATE_HISTGRAM;
devp->flags &= (~VDIN_FLAG_ISR_REQ);
devp->flags &= (~VDIN_FLAG_FS_OPENED);