diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-04-06 11:03:40 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-10 14:42:45 -0300 |
commit | 9d826ce8122fc634c1b67bc6f8985ccfbd565d86 (patch) | |
tree | 72717594ede1d827ac76ce1c7f2b371e055a2a8a /drivers/media | |
parent | 0866df8dffd514185bfab0d205db76e4c02cf1e4 (diff) | |
download | talos-obmc-linux-9d826ce8122fc634c1b67bc6f8985ccfbd565d86.tar.gz talos-obmc-linux-9d826ce8122fc634c1b67bc6f8985ccfbd565d86.zip |
[media] coda: do not enumerate YUYV if VDOA is not available
TRY_FMT already disables the YUYV format if the VDOA is not available.
ENUM_FMT must do the same.
Fixes: d40e98c13b3e ("[media] coda: support YUYV output if VDOA is used")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 95e4648f18e6..d523e990d509 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -390,6 +390,7 @@ static int coda_enum_fmt(struct file *file, void *priv, { struct video_device *vdev = video_devdata(file); const struct coda_video_device *cvd = to_coda_video_device(vdev); + struct coda_ctx *ctx = fh_to_ctx(priv); const u32 *formats; if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) @@ -402,6 +403,11 @@ static int coda_enum_fmt(struct file *file, void *priv, if (f->index >= CODA_MAX_FORMATS || formats[f->index] == 0) return -EINVAL; + /* Skip YUYV if the vdoa is not available */ + if (!ctx->vdoa && f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && + formats[f->index] == V4L2_PIX_FMT_YUYV) + return -EINVAL; + f->pixelformat = formats[f->index]; return 0; |