]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1cae679ba325474b7be5ba8139af672502e14ddf
treecc8aa020e4032ea73a8afdfc986a1c8b14368245
parent3c622b58418eb4e95b075d9286890a3d280fe2fa
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