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

fail: v4l2-test-formats.cpp(1576): IS_DECODER(node)
test Cropping: 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 af6c59e..94fb4d2 100644 (file)
@@ -933,7 +933,8 @@ static int coda_g_selection(struct file *file, void *fh,
                rsel = &r;
                /* fallthrough */
        case V4L2_SEL_TGT_CROP:
-               if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
+               if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT ||
+                   ctx->inst_type == CODA_INST_DECODER)
                        return -EINVAL;
                break;
        case V4L2_SEL_TGT_COMPOSE_BOUNDS: