Commit 4a31b52f authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

[media] coda: dequeue buffers on streamoff

This is needed to decrease the q->owned_by_drv_count to zero before
__vb2_queue_cancel is called, to avoid the WARN_ON therein.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent b906352c
...@@ -1084,6 +1084,7 @@ static void coda_stop_streaming(struct vb2_queue *q) ...@@ -1084,6 +1084,7 @@ static void coda_stop_streaming(struct vb2_queue *q)
{ {
struct coda_ctx *ctx = vb2_get_drv_priv(q); struct coda_ctx *ctx = vb2_get_drv_priv(q);
struct coda_dev *dev = ctx->dev; struct coda_dev *dev = ctx->dev;
struct vb2_buffer *buf;
if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
v4l2_dbg(1, coda_debug, &dev->v4l2_dev, v4l2_dbg(1, coda_debug, &dev->v4l2_dev,
...@@ -1091,7 +1092,11 @@ static void coda_stop_streaming(struct vb2_queue *q) ...@@ -1091,7 +1092,11 @@ static void coda_stop_streaming(struct vb2_queue *q)
ctx->streamon_out = 0; ctx->streamon_out = 0;
coda_bit_stream_end_flag(ctx); coda_bit_stream_end_flag(ctx);
ctx->isequence = 0; ctx->isequence = 0;
while ((buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx)))
v4l2_m2m_buf_done(buf, VB2_BUF_STATE_ERROR);
} else { } else {
v4l2_dbg(1, coda_debug, &dev->v4l2_dev, v4l2_dbg(1, coda_debug, &dev->v4l2_dev,
"%s: capture\n", __func__); "%s: capture\n", __func__);
...@@ -1099,6 +1104,9 @@ static void coda_stop_streaming(struct vb2_queue *q) ...@@ -1099,6 +1104,9 @@ static void coda_stop_streaming(struct vb2_queue *q)
ctx->osequence = 0; ctx->osequence = 0;
ctx->sequence_offset = 0; ctx->sequence_offset = 0;
while ((buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx)))
v4l2_m2m_buf_done(buf, VB2_BUF_STATE_ERROR);
} }
if (!ctx->streamon_out && !ctx->streamon_cap) { if (!ctx->streamon_out && !ctx->streamon_cap) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment