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)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:20 +0000 (11:02 +0200)
commit67e33dd957880879e785cfea83a3aa24bd5c5577
treecc8aa020e4032ea73a8afdfc986a1c8b14368245
parente223d45b53433def67a250f7bbfd958043c70bf6
media: coda: limit frame interval enumeration to supported encoder frame sizes

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>
drivers/media/platform/chips-media/coda-common.c