media: coda: do not enforce 512-byte initial bitstream payload on CODA960
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 18 Jun 2019 16:45:20 +0000 (12:45 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 24 Jun 2019 18:31:23 +0000 (14:31 -0400)
On CODA960, sequence initialization can succeed if less than 512 bytes
are ready in the bitstream ring buffer.
On other variants, warn about too small payload in start_streaming.

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+samsung@kernel.org>
drivers/media/platform/coda/coda-common.c

index 19e3afa4f24d0a4a4c6e5da8168bea28240d41c6..1f1eb9685bc49ed38cb3705e6d4eeaa9ce6a69ee 100644 (file)
@@ -1790,7 +1790,9 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
                        coda_fill_bitstream(ctx, &list);
                        mutex_unlock(&ctx->bitstream_mutex);
 
-                       if (coda_get_bitstream_payload(ctx) < 512) {
+                       if (ctx->dev->devtype->product != CODA_960 &&
+                           coda_get_bitstream_payload(ctx) < 512) {
+                               v4l2_err(v4l2_dev, "start payload < 512\n");
                                ret = -EINVAL;
                                goto err;
                        }