]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: hantro: Be more accurate on pixel formats step_width constraints
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>
Wed, 18 May 2022 08:53:49 +0000 (09:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:02 +0000 (14:41 +0200)
commit2a26eeb9c3a64f46f21665a2dc9d73e8e23f195a
treeccccce956d56b550c580dacab9643b932d21774d
parent1355f7a140d7cf0ad9cd3a2cf69910674869b956
media: hantro: Be more accurate on pixel formats step_width constraints

[ Upstream commit 135ad96cb4d6bd6dace030846fe5c7ea890411ab ]

On Hantro G2 decoder on IMX8MQ strides requirements aren't the same
for NV12_4L4 and NV12 pixel formats. The first one use a 4 bytes padding
while the last one needs 16 bytes.
To be sure to provide the correct stride in all cases we need:
- to relax the constraints on codec formats so set step_width to 4
- use capture queue format and not the output queue format when applying
  the pixel format constraints.
- put the correct step_width constraints on each pixel format.

Move HEVC SPS validation in hantro_hevc.c to be able to perform it
when setting sps control and when starting to decode the bitstream.
Add a new test in HEVC SPS validation function to check if resolution
is still matching the hardware constraints.

With this SAODBLK_A_MainConcept_4 and SAODBLK_B_MainConcept_4 conformance
tests files are correctly decoded with both NV12 and NV12_4L4 pixel
formats. These two files have a resolution of 1016x760.

Add defines for the various used resolutions.
For other variants than Hantro G2 on IMX8M keep the same step_width to
avoid regressions.

Fluster HEVC test score is now 128/147 vs 126/147 with the both pixel
formats as decoder output.
Fluster VP9 test score stay at 147/303.

[hverkuil: fix trivial checkpatch warnings]

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/hantro/hantro_drv.c
drivers/staging/media/hantro/hantro_hevc.c
drivers/staging/media/hantro/hantro_hw.h
drivers/staging/media/hantro/hantro_v4l2.c
drivers/staging/media/hantro/imx8m_vpu_hw.c
drivers/staging/media/hantro/rockchip_vpu_hw.c
drivers/staging/media/hantro/sama5d4_vdec_hw.c
drivers/staging/media/hantro/sunxi_vpu_hw.c