media: rockchip: isp: get iq statistics data in irq for rdbk mode

Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I6570dbf65ca790646daf3fcc8b81be461b66931f
This commit is contained in:
Hu Kejun
2020-04-28 16:54:13 +08:00
committed by Tao Huang
parent f21184b34d
commit 3818f0768a
2 changed files with 16 additions and 11 deletions

View File

@@ -146,12 +146,13 @@ static void rkisp_stats_vb2_buf_queue(struct vb2_buffer *vb)
struct rkisp_buffer *stats_buf = to_rkisp_buffer(vbuf);
struct vb2_queue *vq = vb->vb2_queue;
struct rkisp_isp_stats_vdev *stats_dev = vq->drv_priv;
unsigned long flags;
stats_buf->vaddr[0] = vb2_plane_vaddr(vb, 0);
spin_lock_bh(&stats_dev->rd_lock);
spin_lock_irqsave(&stats_dev->rd_lock, flags);
list_add_tail(&stats_buf->queue, &stats_dev->stat);
spin_unlock_bh(&stats_dev->rd_lock);
spin_unlock_irqrestore(&stats_dev->rd_lock, flags);
}
static void rkisp_stats_vb2_stop_streaming(struct vb2_queue *vq)
@@ -168,7 +169,7 @@ static void rkisp_stats_vb2_stop_streaming(struct vb2_queue *vq)
tasklet_disable(&stats_vdev->rd_tasklet);
spin_lock_bh(&stats_vdev->rd_lock);
spin_lock_irqsave(&stats_vdev->rd_lock, flags);
for (i = 0; i < RKISP_ISP_STATS_REQ_BUFS_MAX; i++) {
if (list_empty(&stats_vdev->stat))
break;
@@ -177,7 +178,7 @@ static void rkisp_stats_vb2_stop_streaming(struct vb2_queue *vq)
list_del(&buf->queue);
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
}
spin_unlock_bh(&stats_vdev->rd_lock);
spin_unlock_irqrestore(&stats_vdev->rd_lock, flags);
}
static int

View File

@@ -1418,14 +1418,18 @@ rkisp_stats_isr_v2x(struct rkisp_isp_stats_vdev *stats_vdev,
work.isp3a_ris = temp_isp3a_ris | iq_3a_mask;
work.timestamp = ktime_get_ns();
if (!kfifo_is_full(&stats_vdev->rd_kfifo))
kfifo_in(&stats_vdev->rd_kfifo,
&work, sizeof(work));
else
v4l2_err(stats_vdev->vnode.vdev.v4l2_dev,
"stats kfifo is full\n");
if (!IS_HDR_RDBK(dev->hdr.op_mode)) {
if (!kfifo_is_full(&stats_vdev->rd_kfifo))
kfifo_in(&stats_vdev->rd_kfifo,
&work, sizeof(work));
else
v4l2_err(stats_vdev->vnode.vdev.v4l2_dev,
"stats kfifo is full\n");
tasklet_schedule(&stats_vdev->rd_tasklet);
tasklet_schedule(&stats_vdev->rd_tasklet);
} else {
rkisp_stats_send_meas_v2x(stats_vdev, &work);
}
}
/*