media: coda: disable encoder compose selections
authorPhilipp Zabel <p.zabel@pengutronix.de>
Sun, 10 Nov 2019 06:26:11 +0000 (07:26 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 10 Nov 2019 06:26:11 +0000 (07:26 +0100)
Disable capture side compose selections for the encoder.
This fixes the following v4l2-compliance complaint:

fail: v4l2-test-formats.cpp(1662): IS_ENCODER(node)
test Composing: 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>
drivers/media/platform/coda/coda-common.c

index 5a38808c8695551cdc5bacd2a399c9cd18db5dfc..af6c59e0513824e45d46efd57ba0bc7349442f8c 100644 (file)
@@ -942,7 +942,8 @@ static int coda_g_selection(struct file *file, void *fh,
                /* fallthrough */
        case V4L2_SEL_TGT_COMPOSE:
        case V4L2_SEL_TGT_COMPOSE_DEFAULT:
-               if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+               if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ||
+                   ctx->inst_type == CODA_INST_ENCODER)
                        return -EINVAL;
                break;
        default: