media: coda: limit frame interval enumeration to supported encoder frame sizes
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 26 Apr 2022 09:15:55 +0000 (11:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:37 +0000 (10:22 +0200)
commita1f2cb0a26133f2c013a42aa8d1b1b2ce691631d
tree7df60c386afb7fe7ebfba6a239e87111a7ad3bc2
parenteeb4819e94aa69767b9e5591e70c63e8b7c5786a
media: coda: limit frame interval enumeration to supported encoder frame sizes

[ Upstream commit 67e33dd957880879e785cfea83a3aa24bd5c5577 ]

Let VIDIOC_ENUM_FRAMEINTERVALS return -EINVAL if userspace queries
frame intervals for frame sizes unsupported by the encoder. Fixes the
following v4l2-compliance failure:

fail: v4l2-test-formats.cpp(123): found frame intervals for invalid size 47x16
fail: v4l2-test-formats.cpp(282): node->codec_mask & STATEFUL_ENCODER
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL

[hverkuil: drop incorrect 'For decoder devices, return -ENOTTY.' in the commit log]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/coda/coda-common.c