@@ -205,6 +205,11 @@ static int rga_buf_start_streaming(struct vb2_queue *q, unsigned int count)
return ret;
}
+ if (V4L2_TYPE_IS_OUTPUT(q->type))
+ ctx->osequence = 0;
+ else
+ ctx->csequence = 0;
+
return 0;
}
@@ -43,6 +43,8 @@ static void device_run(void *prv)
rga->curr = ctx;
src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
+ src->sequence = ctx->osequence++;
+
dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
rga_hw_start(rga, vb_to_rga(src), vb_to_rga(dst));
@@ -75,6 +77,8 @@ static irqreturn_t rga_isr(int irq, void *prv)
v4l2_m2m_buf_copy_metadata(src, dst, true);
+ dst->sequence = ctx->csequence++;
+
v4l2_m2m_buf_done(src, VB2_BUF_STATE_DONE);
v4l2_m2m_buf_done(dst, VB2_BUF_STATE_DONE);
v4l2_m2m_job_finish(rga->m2m_dev, ctx->fh.m2m_ctx);
@@ -57,6 +57,9 @@ struct rga_ctx {
struct rga_frame out;
struct v4l2_ctrl_handler ctrl_handler;
+ int osequence;
+ int csequence;
+
/* Control values */
u32 op;
u32 hflip;
The RGA driver didn't set the sequence numbers of the returned buffers. Keep track of the CAPTURE and OUTPUT sequence numbers, and set the sequence numbers in the source and destination buffers. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- drivers/media/platform/rockchip/rga/rga-buf.c | 5 +++++ drivers/media/platform/rockchip/rga/rga.c | 4 ++++ drivers/media/platform/rockchip/rga/rga.h | 3 +++ 3 files changed, 12 insertions(+)