diff mbox series

[19/28] media: coda: mark the last output buffer on encoder stop command

Message ID 20190618164535.20162-20-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series media: coda: fixes and improvements | expand

Commit Message

Philipp Zabel June 18, 2019, 4:45 p.m. UTC
Mark the last output buffer to be encoded.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/platform/coda/coda-common.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 4002a5b8c9ea..c55124e8b4c8 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1037,12 +1037,17 @@  static int coda_encoder_cmd(struct file *file, void *fh,
 			    struct v4l2_encoder_cmd *ec)
 {
 	struct coda_ctx *ctx = fh_to_ctx(fh);
+	struct vb2_v4l2_buffer *buf;
 	int ret;
 
 	ret = coda_try_encoder_cmd(file, fh, ec);
 	if (ret < 0)
 		return ret;
 
+	buf = v4l2_m2m_last_src_buf(ctx->fh.m2m_ctx);
+	if (buf)
+		buf->flags |= V4L2_BUF_FLAG_LAST;
+
 	/* Set the stream-end flag on this context */
 	ctx->bit_stream_param |= CODA_BIT_STREAM_END_FLAG;