mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-26 05:11:44 -05:00
media: rockchip: rga: fix sequence number handling
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> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
committed by
Hans Verkuil
parent
b8b2b1a5d2
commit
58154dbda4
@@ -195,6 +195,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;
|
||||
|
||||
Reference in New Issue
Block a user