From: Philipp Zabel
Date: Fri, 23 Jan 2015 16:51:21 +0000 (-0300)
Subject: [media] coda: fix try_fmt_vid_out colorspace setting
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f9826e8a759426f6fd722a80a72008bd93132af;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git
[media] coda: fix try_fmt_vid_out colorspace setting
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
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 14953b4df586..ff7da3a5c4ae 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -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