]> git.baikalelectronics.ru Git - kernel.git/commit
media: mtk-vcodec: venc: use platform data for ENUM_FRAMESIZES
authorAlexandre Courbot <acourbot@chromium.org>
Fri, 21 Aug 2020 10:36:05 +0000 (12:36 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 26 Sep 2020 08:10:07 +0000 (10:10 +0200)
commit2818eb961aa56ebb9f1ea965ecd14e83ccd7cb2a
tree59042608076dc18fa21ed2f5243d1783e62c848e
parente01c56ff2efc31066c49ebabd750aa545ec686ce
media: mtk-vcodec: venc: use platform data for ENUM_FRAMESIZES

vidioc_enum_framesizes() assumes that all encoders support H.264 and VP8,
which is not necessarily true and requires to duplicate information about
the supported codecs which is already stored in the platform data.

Fix this by referring to the platform data to find out whether a given
format is supported. Since the supported sizes are all the same
regardless of the format, we can then return a copy of a static value if
the format is supported.

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Acked-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c