[media] coda: fix try_fmt_vid_out colorspace setting
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 23 Jan 2015 16:51:21 +0000 (13:51 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 2 Feb 2015 12:01:39 +0000 (10:01 -0200)
v4l2-compliance complains about invalid colorspace settings being accepted
on the output side. This patch only allows REC709 and JPEG.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/coda/coda-common.c

index 14953b4df586b9fa7b75af6e4c2e1af4c66b4c09..ff7da3a5c4aed73ad6993bd73937d73e7a225da8 100644 (file)
@@ -592,7 +592,11 @@ static int coda_try_fmt_vid_out(struct file *file, void *priv,
        if (ret < 0)
                return ret;
 
-       if (!f->fmt.pix.colorspace) {
+       switch (f->fmt.pix.colorspace) {
+       case V4L2_COLORSPACE_REC709:
+       case V4L2_COLORSPACE_JPEG:
+               break;
+       default:
                if (f->fmt.pix.pixelformat == V4L2_PIX_FMT_JPEG)
                        f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG;
                else