summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda.c
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2014-07-18 12:22:40 +0200
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-21 22:25:19 +0200
commiteabed931dfc3f47f78b93fb49013af6da66682af (patch)
tree548a8822777e9d1344d44a92c0ba12014b073671 /drivers/media/platform/coda.c
parent[media] coda: use CODA_MAX_FRAME_SIZE everywhere (diff)
downloadlinux-eabed931dfc3f47f78b93fb49013af6da66682af.tar.xz
linux-eabed931dfc3f47f78b93fb49013af6da66682af.zip
[media] coda: delay coda_fill_bitstream()
coda_fill_bitstream() calls v4l2_m2m_buf_done() which is no longer allowed before streaming was started. Delay coda_fill_bitstream() until coda_start_streaming() and explicitly set 'start_streaming_called' before calling coda_fill_bitstream() Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/coda.c')
-rw-r--r--drivers/media/platform/coda.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index 79c362bd8383..898eb3dbb8da 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -1680,7 +1680,8 @@ static void coda_buf_queue(struct vb2_buffer *vb)
}
mutex_lock(&ctx->bitstream_mutex);
v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vb);
- coda_fill_bitstream(ctx);
+ if (vb2_is_streaming(vb->vb2_queue))
+ coda_fill_bitstream(ctx);
mutex_unlock(&ctx->bitstream_mutex);
} else {
v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vb);
@@ -2270,6 +2271,11 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
if (q_data_src->fourcc == V4L2_PIX_FMT_H264) {
+ /* copy the buffers that where queued before streamon */
+ mutex_lock(&ctx->bitstream_mutex);
+ coda_fill_bitstream(ctx);
+ mutex_unlock(&ctx->bitstream_mutex);
+
if (coda_get_bitstream_payload(ctx) < 512)
return -EINVAL;
} else {