]> git.baikalelectronics.ru Git - kernel.git/commit
media: mediatek: vcodec: decoder: Fix 4K frame size enumeration
authorChen-Yu Tsai <wenst@chromium.org>
Wed, 6 Jul 2022 08:21:34 +0000 (09:21 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 17:06:56 +0000 (18:06 +0100)
commitfd37e34f471a5172dd9e8cccd0f345e9f74e2c6d
tree89e77b4d39896297bf225e3056bf585779a63103
parentb4bb70e1dbab5483a3500b1ce9ce732f7a42dd01
media: mediatek: vcodec: decoder: Fix 4K frame size enumeration

This partially reverts commit 04a7305443d1 ("media: mediatek: vcodec:
Read max resolution from dec_capability"). In this commit, the maximum
resolution ended up being a function of both the firmware capability and
the current set format.

However, frame size enumeration for output (coded) formats should not
depend on the format set, but should return supported resolutions for
the format requested by userspace.

Fix this so that the driver returns the supported resolutions correctly,
even if the instance only has default settings, or if the output format
is currently set to VP8F, which does not support 4K.

This adds an copy of special casing for !VP8 and 4K support. The other
existing copy will be removed when .max_{width,height} are removed from
|struct mtk_vcodec_ctx| in a subsequent patch.

Fixes: 04a7305443d1 ("media: mediatek: vcodec: Read max resolution from dec_capability")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c