Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Tretter and committed by
Hans Verkuil
58154dbd b8b2b1a5

+12
+5
drivers/media/platform/rockchip/rga/rga-buf.c
··· 195 195 return ret; 196 196 } 197 197 198 + if (V4L2_TYPE_IS_OUTPUT(q->type)) 199 + ctx->osequence = 0; 200 + else 201 + ctx->csequence = 0; 202 + 198 203 return 0; 199 204 } 200 205
+4
drivers/media/platform/rockchip/rga/rga.c
··· 43 43 rga->curr = ctx; 44 44 45 45 src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); 46 + src->sequence = ctx->osequence++; 47 + 46 48 dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); 47 49 48 50 rga_hw_start(rga, vb_to_rga(src), vb_to_rga(dst)); ··· 76 74 WARN_ON(!dst); 77 75 78 76 v4l2_m2m_buf_copy_metadata(src, dst, true); 77 + 78 + dst->sequence = ctx->csequence++; 79 79 80 80 v4l2_m2m_buf_done(src, VB2_BUF_STATE_DONE); 81 81 v4l2_m2m_buf_done(dst, VB2_BUF_STATE_DONE);
+3
drivers/media/platform/rockchip/rga/rga.h
··· 57 57 struct rga_frame out; 58 58 struct v4l2_ctrl_handler ctrl_handler; 59 59 60 + int osequence; 61 + int csequence; 62 + 60 63 /* Control values */ 61 64 u32 op; 62 65 u32 hflip;