]> git.baikalelectronics.ru Git - kernel.git/commit
media: mediatek: vcodec: decoder: Fix resolution clamping in TRY_FMT
authorChen-Yu Tsai <wenst@chromium.org>
Wed, 6 Jul 2022 08:21:36 +0000 (09:21 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 17:08:40 +0000 (18:08 +0100)
commitc8167eb4e8fed8e68953058d59003ceccaf0f8dc
treee36cda30bf06b5b082392daa329fd2e7e2d860ea
parent4728d543326e58ab515fea048514de98ce1f3df1
media: mediatek: vcodec: decoder: Fix resolution clamping in TRY_FMT

In commit d9c705c02c7e ("media: mediatek: vcodec: Read max resolution
from dec_capability"), TRY_FMT clamps the resolution to the maximum
that was previously set either by default 1080p or the limit set by a
previous S_FMT call. This does not make sense when doing TRY_FMT for
the output side, which may have different capabilities.

Instead, for the output side, find the maximum resolution based on the
pixel format requested. For the capture side, find the maximum
resolution based on the currently set output format.

The maximum resolution is found from the list of per-format frame
sizes, so the patch "media: mediatek: vcodec: dec: Fix 4K frame size
enumeration" is needed.

Fixes: d9c705c02c7e ("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