Commit 9d826ce8 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab
Browse files

[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: d40e98c1 ("[media] coda: support YUYV output if VDOA is used")

Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 0866df8d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;