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)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 20 Jun 2022 09:30:34 +0000 (10:30 +0100)
commit135ad96cb4d6bd6dace030846fe5c7ea890411ab
tree40924d91142f866c2187b37dd757e96e3ae819f7
parentca9dc8d06ab64543a6a31adac5003349c5671218
media: hantro: Be more accurate on pixel formats step_width constraints

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>
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