media: rockchip: vicap refresh cache before memcpy for tools video

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I3cfddddd41fe37e9a04547e52abeb337b556aeed
This commit is contained in:
Zefa Chen
2023-03-10 18:49:13 +08:00
committed by Tao Huang
parent cdc0984c90
commit 80fa2be8ed
3 changed files with 12 additions and 5 deletions

View File

@@ -6502,8 +6502,8 @@ static const struct v4l2_ioctl_ops rkcif_v4l2_ioctl_ops = {
.vidioc_default = rkcif_ioctl_default,
};
static void rkcif_vb_done_oneframe(struct rkcif_stream *stream,
struct vb2_v4l2_buffer *vb_done)
void rkcif_vb_done_oneframe(struct rkcif_stream *stream,
struct vb2_v4l2_buffer *vb_done)
{
const struct cif_output_fmt *fmt = stream->cif_fmt_out;
u32 i;

View File

@@ -636,21 +636,21 @@ retry_done_buf:
if (tools_vdev->stopping) {
rkcif_tools_stop(tools_vdev);
tools_vdev->stopping = false;
rkcif_vb_done_tasklet(stream, buf);
rkcif_vb_done_oneframe(stream, &buf->vb);
spin_lock_irqsave(&tools_vdev->vbq_lock, flags);
while (!list_empty(&tools_vdev->buf_done_head)) {
buf = list_first_entry(&tools_vdev->buf_done_head,
struct rkcif_buffer, queue);
if (buf) {
list_del(&buf->queue);
rkcif_vb_done_tasklet(stream, buf);
rkcif_vb_done_oneframe(stream, &buf->vb);
}
}
spin_unlock_irqrestore(&tools_vdev->vbq_lock, flags);
wake_up(&tools_vdev->wq_stopped);
return;
}
rkcif_vb_done_tasklet(stream, buf);
rkcif_vb_done_oneframe(stream, &buf->vb);
if (!list_empty(&tools_vdev->buf_head)) {
tools_vdev->curr_buf = list_first_entry(&tools_vdev->buf_head,
@@ -675,6 +675,10 @@ retry_done_buf:
if (!src || !dst)
break;
if (buf->vb.vb2_buf.vb2_queue->mem_ops->finish)
buf->vb.vb2_buf.vb2_queue->mem_ops->finish(buf->vb.vb2_buf.planes[i].mem_priv);
vb2_set_plane_payload(&tools_vdev->curr_buf->vb.vb2_buf, i,
payload_size);
memcpy(dst, src, payload_size);

View File

@@ -884,6 +884,9 @@ void rkcif_config_dvp_clk_sampling_edge(struct rkcif_device *dev,
void rkcif_enable_dvp_clk_dual_edge(struct rkcif_device *dev, bool on);
void rkcif_reset_work(struct work_struct *work);
void rkcif_vb_done_oneframe(struct rkcif_stream *stream,
struct vb2_v4l2_buffer *vb_done);
int rkcif_init_rx_buf(struct rkcif_stream *stream, int buf_num);
void rkcif_free_rx_buf(struct rkcif_stream *stream, int buf_num);