diff options
| author | Philipp Zabel <p.zabel@pengutronix.de> | 2022-04-06 09:53:53 +0100 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-04-24 08:47:42 +0100 |
| commit | e4b5793633964c1508d0e84ae79314b331ef1a0c (patch) | |
| tree | 1c290b89bb972ce42bb987eede2ae55d8a9f419e | |
| parent | 26087650eb351cb7541ac3ad09dd0a3e122bf36f (diff) | |
| download | linux-e4b5793633964c1508d0e84ae79314b331ef1a0c.tar.bz2 | |
media: coda: jpeg: start streaming without valid header
Stop bailing out on JPEG header parsing errors during streamon.
This allows userspace to provide valid output buffers later and
fixes a v4l2-compliance streaming test failure:
fail: v4l2-test-buffers.cpp(1429): node->streamon(q.g_type())
test MMAP (no poll): FAIL
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
| -rw-r--r-- | drivers/media/platform/chips-media/coda-common.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/platform/chips-media/coda-common.c b/drivers/media/platform/chips-media/coda-common.c index 3eaf0e7e6b20..7b4942bb6c2c 100644 --- a/drivers/media/platform/chips-media/coda-common.c +++ b/drivers/media/platform/chips-media/coda-common.c @@ -1999,9 +1999,13 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) */ if (q_data_src->fourcc == V4L2_PIX_FMT_JPEG) { buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); - ret = coda_jpeg_decode_header(ctx, &buf->vb2_buf); - if (ret < 0) - goto err; + coda_jpeg_decode_header(ctx, &buf->vb2_buf); + /* + * We have to start streaming even if the first buffer + * does not contain a valid JPEG image. The error will + * be caught during device run and will be signalled + * via the capture buffer error flag. + */ q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); q_data_dst->width = round_up(q_data_src->width, 16); |