2020-03-03 14:39:59

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH v6 0/5] media: meson: vdec: Add VP9 decoding support

Hello,

This patchset aims to bring VP9 decoding support to Amlogic GXL, G12A & SM1
platforms for the amlogic stateful video decoder driver.

With this, it passes v4l2-compliance with streaming on Amlogic G12A and
Amlogic SM1 SoCs successfully using the stream at [1] with a fixed
pyv4l2compliance script for VP9 at [2].

The original script kept the IVF headers in the stream, confusing the
decoder. The fixed script only extracts the payload from the IVF container.

The decoder has been tested using the Google CTS TestVectorsIttiam VP9 yuv420
samples and the VP9 Decoder Performance streams at [5], decoding all streams from
Profile 0 and 2 up to Level 4.1, with 10bit downsampling to 8bit.

This patchset depends on :
- H.264 and compliance v7 at [4]

Changes since v5 at [9]:
- Fixed sparse warnings in codec_hevc_common.h/codec_vp9.c/vdec_hevc.c
- No smatch warnings issued

Changes since v4 at [8]:
- Fixes checkpatch warning on patches 3 & 5

Changes since v3 at [7]:
- fixes necessary spare ref buffer handling in parser
- added a comment to indicate how it's handled
- fix VP9 on SM1, was working with G12A firmware, but needed some changed with SM1 specific firmware
- pushed (gxl) and switched to missing (sm1) vp9 firmwares to linux-firmware repo

Changes since v2 at [6]:
- Rebased on H.264 and compliance at [4]

Changes since v1 at [3]:
- Fixed compliance for delta frame resize, but proper ref keeping is broken
- Added warns for delta frame resize, to be fixed in a following patchset
- Added VP9 probabilities parsing and transformation support to decore the VP9 performance streams
- Fixed refs keeping, avoid deleting necessary refs for next frame
- Properly used the kernel clamp_val() macros
- Zeroed the workspace to avoid refs handling glitches
- Add lock around the flush & stop to avoid race between IRQ and drain/stop

[1] https://github.com/superna9999/pyv4l2compliance/raw/tests/output/Jellyfish_1080_10s_5MB.vp9.hdr
[2] https://github.com/superna9999/pyv4l2compliance
[3] https://lore.kernel.org/linux-media/[email protected]
[4] https://lore.kernel.org/linux-media/[email protected]
[5] https://www.webmproject.org/vp9/levels/
[6] https://lore.kernel.org/linux-media/[email protected]
[7] https://lore.kernel.org/linux-media/[email protected]
[8] https://lore.kernel.org/linux-media/[email protected]
[9] https://lore.kernel.org/linux-media/[email protected]

The compliance log is:
# v4l2-compliance --stream-from-hdr Jellyfish_1080_10s_5MB.vp9.hdr -s 200
v4l2-compliance SHA: 7ead0e1856b89f2e19369af452bb03fd0cd16793, 64 bits

Compliance test for meson-vdec device /dev/video0:

Driver Info:
Driver name : meson-vdec
Card type : Amlogic Video Decoder
Bus info : platform:meson-vdec
Driver version : 5.5.0
Capabilities : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Detected Stateful Decoder

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 2 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Test input 0:

Streaming ioctls:
test read/write: OK (Not Supported)
test blocking wait: OK
Video Capture Multiplanar: Captured 198 buffers
test MMAP (select): OK
Video Capture Multiplanar: Captured 198 buffers
test MMAP (epoll): OK
test USERPTR (select): OK (Not Supported)
test DMABUF: Cannot test, specify --expbuf-device

Total for meson-vdec device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0

Maxime Jourdan (4):
media: meson: vdec: add helpers for lossless framebuffer compression
buffers
media: meson: vdec: add common HEVC decoder support
media: meson: vdec: add VP9 input support
media: meson: vdec: add VP9 decoder support

Neil Armstrong (1):
media: meson: vdec: align stride on 32 bytes

drivers/staging/media/meson/vdec/Makefile | 4 +-
.../media/meson/vdec/codec_hevc_common.c | 284 +++
.../media/meson/vdec/codec_hevc_common.h | 80 +
drivers/staging/media/meson/vdec/codec_vp9.c | 2141 +++++++++++++++++
drivers/staging/media/meson/vdec/codec_vp9.h | 13 +
drivers/staging/media/meson/vdec/esparser.c | 150 +-
drivers/staging/media/meson/vdec/hevc_regs.h | 218 ++
drivers/staging/media/meson/vdec/vdec.c | 15 +-
.../staging/media/meson/vdec/vdec_helpers.c | 35 +-
.../staging/media/meson/vdec/vdec_helpers.h | 4 +
drivers/staging/media/meson/vdec/vdec_hevc.c | 231 ++
drivers/staging/media/meson/vdec/vdec_hevc.h | 13 +
.../staging/media/meson/vdec/vdec_platform.c | 38 +
13 files changed, 3213 insertions(+), 13 deletions(-)
create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.c
create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.h
create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.c
create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.h
create mode 100644 drivers/staging/media/meson/vdec/hevc_regs.h
create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.c
create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.h

--
2.22.0


2020-03-03 14:40:07

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH v6 2/5] media: meson: vdec: add helpers for lossless framebuffer compression buffers

From: Maxime Jourdan <[email protected]>

Add helpers to support the lossless framebuffer compression format that
will be used in HEVC & VP9 decoders when decoding 10bit content for
downsampling to 8bit NV12 and later proper compressed buffer support.

Signed-off-by: Maxime Jourdan <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
---
.../staging/media/meson/vdec/vdec_helpers.c | 27 +++++++++++++++++++
.../staging/media/meson/vdec/vdec_helpers.h | 4 +++
2 files changed, 31 insertions(+)

diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c
index 3f7929c54dc6..caec0fb60338 100644
--- a/drivers/staging/media/meson/vdec/vdec_helpers.c
+++ b/drivers/staging/media/meson/vdec/vdec_helpers.c
@@ -50,6 +50,33 @@ void amvdec_write_parser(struct amvdec_core *core, u32 reg, u32 val)
}
EXPORT_SYMBOL_GPL(amvdec_write_parser);

+/* 4 KiB per 64x32 block */
+u32 amvdec_am21c_body_size(u32 width, u32 height)
+{
+ u32 width_64 = ALIGN(width, 64) / 64;
+ u32 height_32 = ALIGN(height, 32) / 32;
+
+ return SZ_4K * width_64 * height_32;
+}
+EXPORT_SYMBOL_GPL(amvdec_am21c_body_size);
+
+/* 32 bytes per 128x64 block */
+u32 amvdec_am21c_head_size(u32 width, u32 height)
+{
+ u32 width_128 = ALIGN(width, 128) / 128;
+ u32 height_64 = ALIGN(height, 64) / 64;
+
+ return 32 * width_128 * height_64;
+}
+EXPORT_SYMBOL_GPL(amvdec_am21c_head_size);
+
+u32 amvdec_am21c_size(u32 width, u32 height)
+{
+ return ALIGN(amvdec_am21c_body_size(width, height) +
+ amvdec_am21c_head_size(width, height), SZ_64K);
+}
+EXPORT_SYMBOL_GPL(amvdec_am21c_size);
+
static int canvas_alloc(struct amvdec_session *sess, u8 *canvas_id)
{
int ret;
diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.h b/drivers/staging/media/meson/vdec/vdec_helpers.h
index 165e6293ffba..cfaed52ab526 100644
--- a/drivers/staging/media/meson/vdec/vdec_helpers.h
+++ b/drivers/staging/media/meson/vdec/vdec_helpers.h
@@ -27,6 +27,10 @@ void amvdec_clear_dos_bits(struct amvdec_core *core, u32 reg, u32 val);
u32 amvdec_read_parser(struct amvdec_core *core, u32 reg);
void amvdec_write_parser(struct amvdec_core *core, u32 reg, u32 val);

+u32 amvdec_am21c_body_size(u32 width, u32 height);
+u32 amvdec_am21c_head_size(u32 width, u32 height);
+u32 amvdec_am21c_size(u32 width, u32 height);
+
/**
* amvdec_dst_buf_done_idx() - Signal that a buffer is done decoding
*
--
2.22.0

2020-03-03 16:28:23

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH v6 0/5] media: meson: vdec: Add VP9 decoding support

Hi Neil,

I still get sparse warnings:

drivers/staging/media/meson/vdec/codec_hevc_common.h:15:18: warning: 'vdec_hevc_parser_cmd' defined but not used [-Wunused-const-variable=]
drivers/staging/media/meson/vdec/esparser.c:83: warning: Function parameter or member 'core' not described in 'vp9_update_header'
drivers/staging/media/meson/vdec/esparser.c:83: warning: Function parameter or member 'buf' not described in 'vp9_update_header'
drivers/staging/media/meson/vdec/codec_vp9.c:1333: warning: Function parameter or member 'sess' not described in 'codec_vp9_fetch_rpm'

They look trivial to fix to me.

The v7 series is fine, but I prefer to wait until this v6 is OK as well so I can
combine them in one PR.

Regards,

Hans

On 03/03/2020 15:37, Neil Armstrong wrote:
> Hello,
>
> This patchset aims to bring VP9 decoding support to Amlogic GXL, G12A & SM1
> platforms for the amlogic stateful video decoder driver.
>
> With this, it passes v4l2-compliance with streaming on Amlogic G12A and
> Amlogic SM1 SoCs successfully using the stream at [1] with a fixed
> pyv4l2compliance script for VP9 at [2].
>
> The original script kept the IVF headers in the stream, confusing the
> decoder. The fixed script only extracts the payload from the IVF container.
>
> The decoder has been tested using the Google CTS TestVectorsIttiam VP9 yuv420
> samples and the VP9 Decoder Performance streams at [5], decoding all streams from
> Profile 0 and 2 up to Level 4.1, with 10bit downsampling to 8bit.
>
> This patchset depends on :
> - H.264 and compliance v7 at [4]
>
> Changes since v5 at [9]:
> - Fixed sparse warnings in codec_hevc_common.h/codec_vp9.c/vdec_hevc.c
> - No smatch warnings issued
>
> Changes since v4 at [8]:
> - Fixes checkpatch warning on patches 3 & 5
>
> Changes since v3 at [7]:
> - fixes necessary spare ref buffer handling in parser
> - added a comment to indicate how it's handled
> - fix VP9 on SM1, was working with G12A firmware, but needed some changed with SM1 specific firmware
> - pushed (gxl) and switched to missing (sm1) vp9 firmwares to linux-firmware repo
>
> Changes since v2 at [6]:
> - Rebased on H.264 and compliance at [4]
>
> Changes since v1 at [3]:
> - Fixed compliance for delta frame resize, but proper ref keeping is broken
> - Added warns for delta frame resize, to be fixed in a following patchset
> - Added VP9 probabilities parsing and transformation support to decore the VP9 performance streams
> - Fixed refs keeping, avoid deleting necessary refs for next frame
> - Properly used the kernel clamp_val() macros
> - Zeroed the workspace to avoid refs handling glitches
> - Add lock around the flush & stop to avoid race between IRQ and drain/stop
>
> [1] https://github.com/superna9999/pyv4l2compliance/raw/tests/output/Jellyfish_1080_10s_5MB.vp9.hdr
> [2] https://github.com/superna9999/pyv4l2compliance
> [3] https://lore.kernel.org/linux-media/[email protected]
> [4] https://lore.kernel.org/linux-media/[email protected]
> [5] https://www.webmproject.org/vp9/levels/
> [6] https://lore.kernel.org/linux-media/[email protected]
> [7] https://lore.kernel.org/linux-media/[email protected]
> [8] https://lore.kernel.org/linux-media/[email protected]
> [9] https://lore.kernel.org/linux-media/[email protected]
>
> The compliance log is:
> # v4l2-compliance --stream-from-hdr Jellyfish_1080_10s_5MB.vp9.hdr -s 200
> v4l2-compliance SHA: 7ead0e1856b89f2e19369af452bb03fd0cd16793, 64 bits
>
> Compliance test for meson-vdec device /dev/video0:
>
> Driver Info:
> Driver name : meson-vdec
> Card type : Amlogic Video Decoder
> Bus info : platform:meson-vdec
> Driver version : 5.5.0
> Capabilities : 0x84204000
> Video Memory-to-Memory Multiplanar
> Streaming
> Extended Pix Format
> Device Capabilities
> Device Caps : 0x04204000
> Video Memory-to-Memory Multiplanar
> Streaming
> Extended Pix Format
> Detected Stateful Decoder
>
> Required ioctls:
> test VIDIOC_QUERYCAP: OK
>
> Allow for multiple opens:
> test second /dev/video0 open: OK
> test VIDIOC_QUERYCAP: OK
> test VIDIOC_G/S_PRIORITY: OK
> test for unlimited opens: OK
>
> Debug ioctls:
> test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> test VIDIOC_LOG_STATUS: OK (Not Supported)
>
> Input ioctls:
> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> test VIDIOC_ENUMAUDIO: OK (Not Supported)
> test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDIO: OK (Not Supported)
> Inputs: 0 Audio Inputs: 0 Tuners: 0
>
> Output ioctls:
> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> Outputs: 0 Audio Outputs: 0 Modulators: 0
>
> Input/Output configuration ioctls:
> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> test VIDIOC_G/S_EDID: OK (Not Supported)
>
> Control ioctls:
> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> test VIDIOC_QUERYCTRL: OK
> test VIDIOC_G/S_CTRL: OK
> test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> Standard Controls: 2 Private Controls: 0
>
> Format ioctls:
> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> test VIDIOC_G/S_PARM: OK (Not Supported)
> test VIDIOC_G_FBUF: OK (Not Supported)
> test VIDIOC_G_FMT: OK
> test VIDIOC_TRY_FMT: OK
> test VIDIOC_S_FMT: OK
> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> test Cropping: OK (Not Supported)
> test Composing: OK (Not Supported)
> test Scaling: OK (Not Supported)
>
> Codec ioctls:
> test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> test VIDIOC_(TRY_)DECODER_CMD: OK
>
> Buffer ioctls:
> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> test VIDIOC_EXPBUF: OK
> test Requests: OK (Not Supported)
>
> Test input 0:
>
> Streaming ioctls:
> test read/write: OK (Not Supported)
> test blocking wait: OK
> Video Capture Multiplanar: Captured 198 buffers
> test MMAP (select): OK
> Video Capture Multiplanar: Captured 198 buffers
> test MMAP (epoll): OK
> test USERPTR (select): OK (Not Supported)
> test DMABUF: Cannot test, specify --expbuf-device
>
> Total for meson-vdec device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
>
> Maxime Jourdan (4):
> media: meson: vdec: add helpers for lossless framebuffer compression
> buffers
> media: meson: vdec: add common HEVC decoder support
> media: meson: vdec: add VP9 input support
> media: meson: vdec: add VP9 decoder support
>
> Neil Armstrong (1):
> media: meson: vdec: align stride on 32 bytes
>
> drivers/staging/media/meson/vdec/Makefile | 4 +-
> .../media/meson/vdec/codec_hevc_common.c | 284 +++
> .../media/meson/vdec/codec_hevc_common.h | 80 +
> drivers/staging/media/meson/vdec/codec_vp9.c | 2141 +++++++++++++++++
> drivers/staging/media/meson/vdec/codec_vp9.h | 13 +
> drivers/staging/media/meson/vdec/esparser.c | 150 +-
> drivers/staging/media/meson/vdec/hevc_regs.h | 218 ++
> drivers/staging/media/meson/vdec/vdec.c | 15 +-
> .../staging/media/meson/vdec/vdec_helpers.c | 35 +-
> .../staging/media/meson/vdec/vdec_helpers.h | 4 +
> drivers/staging/media/meson/vdec/vdec_hevc.c | 231 ++
> drivers/staging/media/meson/vdec/vdec_hevc.h | 13 +
> .../staging/media/meson/vdec/vdec_platform.c | 38 +
> 13 files changed, 3213 insertions(+), 13 deletions(-)
> create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.c
> create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.h
> create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.c
> create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.h
> create mode 100644 drivers/staging/media/meson/vdec/hevc_regs.h
> create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.c
> create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.h
>

2020-03-04 09:31:46

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH v6 0/5] media: meson: vdec: Add VP9 decoding support

Hi,

On 03/03/2020 17:27, Hans Verkuil wrote:
> Hi Neil,
>
> I still get sparse warnings:
>
> drivers/staging/media/meson/vdec/codec_hevc_common.h:15:18: warning: 'vdec_hevc_parser_cmd' defined but not used [-Wunused-const-variable=]
> drivers/staging/media/meson/vdec/esparser.c:83: warning: Function parameter or member 'core' not described in 'vp9_update_header'
> drivers/staging/media/meson/vdec/esparser.c:83: warning: Function parameter or member 'buf' not described in 'vp9_update_header'
> drivers/staging/media/meson/vdec/codec_vp9.c:1333: warning: Function parameter or member 'sess' not described in 'codec_vp9_fetch_rpm'
>
> They look trivial to fix to me.

Erf, I ran sparse, smatch and fixed everything but simply forgot to run W=1...

Will fix these and send a v7.

Neill

>
> The v7 series is fine, but I prefer to wait until this v6 is OK as well so I can
> combine them in one PR.
>
> Regards,
>
> Hans
>
> On 03/03/2020 15:37, Neil Armstrong wrote:
>> Hello,
>>
>> This patchset aims to bring VP9 decoding support to Amlogic GXL, G12A & SM1
>> platforms for the amlogic stateful video decoder driver.
>>
>> With this, it passes v4l2-compliance with streaming on Amlogic G12A and
>> Amlogic SM1 SoCs successfully using the stream at [1] with a fixed
>> pyv4l2compliance script for VP9 at [2].
>>
>> The original script kept the IVF headers in the stream, confusing the
>> decoder. The fixed script only extracts the payload from the IVF container.
>>
>> The decoder has been tested using the Google CTS TestVectorsIttiam VP9 yuv420
>> samples and the VP9 Decoder Performance streams at [5], decoding all streams from
>> Profile 0 and 2 up to Level 4.1, with 10bit downsampling to 8bit.
>>
>> This patchset depends on :
>> - H.264 and compliance v7 at [4]
>>
>> Changes since v5 at [9]:
>> - Fixed sparse warnings in codec_hevc_common.h/codec_vp9.c/vdec_hevc.c
>> - No smatch warnings issued
>>
>> Changes since v4 at [8]:
>> - Fixes checkpatch warning on patches 3 & 5
>>
>> Changes since v3 at [7]:
>> - fixes necessary spare ref buffer handling in parser
>> - added a comment to indicate how it's handled
>> - fix VP9 on SM1, was working with G12A firmware, but needed some changed with SM1 specific firmware
>> - pushed (gxl) and switched to missing (sm1) vp9 firmwares to linux-firmware repo
>>
>> Changes since v2 at [6]:
>> - Rebased on H.264 and compliance at [4]
>>
>> Changes since v1 at [3]:
>> - Fixed compliance for delta frame resize, but proper ref keeping is broken
>> - Added warns for delta frame resize, to be fixed in a following patchset
>> - Added VP9 probabilities parsing and transformation support to decore the VP9 performance streams
>> - Fixed refs keeping, avoid deleting necessary refs for next frame
>> - Properly used the kernel clamp_val() macros
>> - Zeroed the workspace to avoid refs handling glitches
>> - Add lock around the flush & stop to avoid race between IRQ and drain/stop
>>
>> [1] https://github.com/superna9999/pyv4l2compliance/raw/tests/output/Jellyfish_1080_10s_5MB.vp9.hdr
>> [2] https://github.com/superna9999/pyv4l2compliance
>> [3] https://lore.kernel.org/linux-media/[email protected]
>> [4] https://lore.kernel.org/linux-media/[email protected]
>> [5] https://www.webmproject.org/vp9/levels/
>> [6] https://lore.kernel.org/linux-media/[email protected]
>> [7] https://lore.kernel.org/linux-media/[email protected]
>> [8] https://lore.kernel.org/linux-media/[email protected]
>> [9] https://lore.kernel.org/linux-media/[email protected]
>>
>> The compliance log is:
>> # v4l2-compliance --stream-from-hdr Jellyfish_1080_10s_5MB.vp9.hdr -s 200
>> v4l2-compliance SHA: 7ead0e1856b89f2e19369af452bb03fd0cd16793, 64 bits
>>
>> Compliance test for meson-vdec device /dev/video0:
>>
>> Driver Info:
>> Driver name : meson-vdec
>> Card type : Amlogic Video Decoder
>> Bus info : platform:meson-vdec
>> Driver version : 5.5.0
>> Capabilities : 0x84204000
>> Video Memory-to-Memory Multiplanar
>> Streaming
>> Extended Pix Format
>> Device Capabilities
>> Device Caps : 0x04204000
>> Video Memory-to-Memory Multiplanar
>> Streaming
>> Extended Pix Format
>> Detected Stateful Decoder
>>
>> Required ioctls:
>> test VIDIOC_QUERYCAP: OK
>>
>> Allow for multiple opens:
>> test second /dev/video0 open: OK
>> test VIDIOC_QUERYCAP: OK
>> test VIDIOC_G/S_PRIORITY: OK
>> test for unlimited opens: OK
>>
>> Debug ioctls:
>> test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>> test VIDIOC_LOG_STATUS: OK (Not Supported)
>>
>> Input ioctls:
>> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>> test VIDIOC_ENUMAUDIO: OK (Not Supported)
>> test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>> test VIDIOC_G/S_AUDIO: OK (Not Supported)
>> Inputs: 0 Audio Inputs: 0 Tuners: 0
>>
>> Output ioctls:
>> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>> Outputs: 0 Audio Outputs: 0 Modulators: 0
>>
>> Input/Output configuration ioctls:
>> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>> test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>> test VIDIOC_G/S_EDID: OK (Not Supported)
>>
>> Control ioctls:
>> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>> test VIDIOC_QUERYCTRL: OK
>> test VIDIOC_G/S_CTRL: OK
>> test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>> Standard Controls: 2 Private Controls: 0
>>
>> Format ioctls:
>> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>> test VIDIOC_G/S_PARM: OK (Not Supported)
>> test VIDIOC_G_FBUF: OK (Not Supported)
>> test VIDIOC_G_FMT: OK
>> test VIDIOC_TRY_FMT: OK
>> test VIDIOC_S_FMT: OK
>> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>> test Cropping: OK (Not Supported)
>> test Composing: OK (Not Supported)
>> test Scaling: OK (Not Supported)
>>
>> Codec ioctls:
>> test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>> test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>> test VIDIOC_(TRY_)DECODER_CMD: OK
>>
>> Buffer ioctls:
>> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>> test VIDIOC_EXPBUF: OK
>> test Requests: OK (Not Supported)
>>
>> Test input 0:
>>
>> Streaming ioctls:
>> test read/write: OK (Not Supported)
>> test blocking wait: OK
>> Video Capture Multiplanar: Captured 198 buffers
>> test MMAP (select): OK
>> Video Capture Multiplanar: Captured 198 buffers
>> test MMAP (epoll): OK
>> test USERPTR (select): OK (Not Supported)
>> test DMABUF: Cannot test, specify --expbuf-device
>>
>> Total for meson-vdec device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
>>
>> Maxime Jourdan (4):
>> media: meson: vdec: add helpers for lossless framebuffer compression
>> buffers
>> media: meson: vdec: add common HEVC decoder support
>> media: meson: vdec: add VP9 input support
>> media: meson: vdec: add VP9 decoder support
>>
>> Neil Armstrong (1):
>> media: meson: vdec: align stride on 32 bytes
>>
>> drivers/staging/media/meson/vdec/Makefile | 4 +-
>> .../media/meson/vdec/codec_hevc_common.c | 284 +++
>> .../media/meson/vdec/codec_hevc_common.h | 80 +
>> drivers/staging/media/meson/vdec/codec_vp9.c | 2141 +++++++++++++++++
>> drivers/staging/media/meson/vdec/codec_vp9.h | 13 +
>> drivers/staging/media/meson/vdec/esparser.c | 150 +-
>> drivers/staging/media/meson/vdec/hevc_regs.h | 218 ++
>> drivers/staging/media/meson/vdec/vdec.c | 15 +-
>> .../staging/media/meson/vdec/vdec_helpers.c | 35 +-
>> .../staging/media/meson/vdec/vdec_helpers.h | 4 +
>> drivers/staging/media/meson/vdec/vdec_hevc.c | 231 ++
>> drivers/staging/media/meson/vdec/vdec_hevc.h | 13 +
>> .../staging/media/meson/vdec/vdec_platform.c | 38 +
>> 13 files changed, 3213 insertions(+), 13 deletions(-)
>> create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.c
>> create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.h
>> create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.c
>> create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.h
>> create mode 100644 drivers/staging/media/meson/vdec/hevc_regs.h
>> create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.c
>> create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.h
>>
>