Skip to content

staging: media: cedrus: assorted fixes and VP8 4K support

Jernej Skrabec linux-arm-kernel linux-media linux-staging linux-sunxi lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 0 repliesNew
  2. v110 patches 16 repliesSuperseded

Changes in v2 from the cover letter

- patches 2 and 7: check only the hardware limits in try_ctrl. Check whether the picture fits the buffers in the setup callbacks instead, which fail the job with an error buffer. try_ctrl could be bypassed by setting the control before the buffers were allocated (Nicolas, Sashiko).
- patch 2: describe what the HEVC decoder takes from the SPS.
- patch 7: limit VP8 frames to 4080 pixels in width, as the frame size register holds 8-bit macroblock counts.
- patch 3: pass the reference type instead of a bool (Nicolas), and keep the reference type of the first field when the second field of a pair is decoded into the same buffer (Sashiko).
- patch 4: halve the macroblock aligned height for the boundary of a field, like the vendor library does (Nicolas).
- patch 10: new.
- patch 11: set the DRAM buffer sizes only once both buffers are allocated and clear them first, so that a failed allocation or the data of another codec can't leave stale sizes (Sashiko).
- collected Reviewed-by tags.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11staging: media: cedrus: free MV-col buffers in buf_cleanupdrivers/staging/media/sunxi/cedrus/cedrus.h drivers/staging/media/sunxi/cedrus/cedrus_h264.c drivers/staging/media/sunxi/cedrus/cedrus_h265.c +1 more+43 -240 replies
2/11staging: media: cedrus: reject too large H.264/HEVC SPSdrivers/staging/media/sunxi/cedrus/cedrus.c drivers/staging/media/sunxi/cedrus/cedrus.h drivers/staging/media/sunxi/cedrus/cedrus_h264.c +3 more+65 -50 replies
3/11staging: media: cedrus: h264: mark long-term references in the frame infodrivers/staging/media/sunxi/cedrus/cedrus_h264.c drivers/staging/media/sunxi/cedrus/cedrus_regs.h+31 -10 replies
4/11staging: media: cedrus: mpeg2: use the field height for field picturesdrivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c+13 -20 replies
5/11staging: media: cedrus: mpeg2: derive the field order of field picturesdrivers/staging/media/sunxi/cedrus/cedrus.h drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c+35 -20 replies
6/11staging: media: cedrus: mpeg2: fix the references of field picturesdrivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c+22 -70 replies
7/11staging: media: cedrus: validate VP8 frame sizedrivers/staging/media/sunxi/cedrus/cedrus.c drivers/staging/media/sunxi/cedrus/cedrus_vp8.c+13 -00 replies
8/11staging: media: cedrus: vp8: use the vendor probability table sizedrivers/staging/media/sunxi/cedrus/cedrus_vp8.c+1 -10 replies
9/11staging: media: cedrus: h616: use the 256-bit DDR modedrivers/staging/media/sunxi/cedrus/cedrus.c drivers/staging/media/sunxi/cedrus/cedrus.h drivers/staging/media/sunxi/cedrus/cedrus_hw.c+25 -50 replies
10/11staging: media: cedrus: h264: clear the DRAM buffer sizes on startdrivers/staging/media/sunxi/cedrus/cedrus_h264.c+8 -00 replies
11/11staging: media: cedrus: vp8: support frames wider than 2048 pixelsdrivers/staging/media/sunxi/cedrus/cedrus.h drivers/staging/media/sunxi/cedrus/cedrus_vp8.c+74 -00 replies

Reviews trailers per patch

7 of 11 patches have a Reviewed-by or Acked-by.

PatchNicolas Dufresne
1/11R-b
2/11
3/11R-b
4/11
5/11R-b
6/11R-b
7/11
8/11R-b
9/11R-b
10/11
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/11] staging: media: cedrus: assorted fixes and VP8 4K support

This series fixes a number of bugs in the Cedrus driver, found while running the conformance suites and comparing with the vendor library, mostly on H616.

Patches 1-10 are fixes:
- patch 1 fixes MV-col buffer leak when the file handle is closed without STREAMOFF,
- patches 2 and 7 reject H.264/HEVC SPS and VP8 frame sizes beyond the hardware limits, and fail jobs whose picture doesn't fit the buffers, preventing memory overruns and hardware hangs,
- patch 3 marks H.264 long-term references, which fixes MR8_BT_B and MR9_BT_B conformance samples,
- patches 4-6 fix MPEG-2 field picture decoding (field height, field order detection and references of the second field),
- patch 8 enlarges VP8 probability table to the size used by the vendor libraries, since the hardware uses the area past it as scratch space,
- patch 9 switches H616 to the 256-bit DDR mode, which fixes corrupted reference chroma in H.264 and VP8,
- patch 10 clears the sizes of the H.264 DRAM buffers on start, which fixes a double free when a narrow H.264 stream follows a wide one on the same file handle.

Patch 11 is new functionality: VP8 decoding of frames wider than 2048 pixels. It depends on patch 10.

Changes in v2:
- patches 2 and 7: check only the hardware limits in try_ctrl. Check whether the picture fits the buffers in the setup callbacks instead, which fail the job with an error buffer. try_ctrl could be bypassed by setting the control before the buffers were allocated (Nicolas, Sashiko).
- patch 2: describe what the HEVC decoder takes from the SPS.
- patch 7: limit VP8 frames to 4080 pixels in width, as the frame size register holds 8-bit macroblock counts.
- patch 3: pass the reference type instead of a bool (Nicolas), and keep the reference type of the first field when the second field of a pair is decoded into the same buffer (Sashiko).
- patch 4: halve the macroblock aligned height for the boundary of a field, like the vendor library does (Nicolas).
- patch 10: new.
- patch 11: set the DRAM buffer sizes only once both buffers are allocated and clear them first, so that a failed allocation or the data of another codec can't leave stale sizes (Sashiko).
- collected Reviewed-by tags.

v1: https://lore.kernel.org/linux-sunxi/[email protected]/

Please take a look.

Best regards,
Jernej

Jernej Skrabec (11):
staging: media: cedrus: free MV-col buffers in buf_cleanup
staging: media: cedrus: reject too large H.264/HEVC SPS
staging: media: cedrus: h264: mark long-term references in the frame
info
staging: media: cedrus: mpeg2: use the field height for field pictures
staging: media: cedrus: mpeg2: derive the field order of field
pictures
staging: media: cedrus: mpeg2: fix the references of field pictures
staging: media: cedrus: validate VP8 frame size
staging: media: cedrus: vp8: use the vendor probability table size
staging: media: cedrus: h616: use the 256-bit DDR mode
staging: media: cedrus: h264: clear the DRAM buffer sizes on start
staging: media: cedrus: vp8: support frames wider than 2048 pixels

 drivers/staging/media/sunxi/cedrus/cedrus.c   | 40 +++++++++-
 drivers/staging/media/sunxi/cedrus/cedrus.h   | 49 ++++++++++++
 .../staging/media/sunxi/cedrus/cedrus_h264.c  | 66 +++++++++++++----
 .../staging/media/sunxi/cedrus/cedrus_h265.c  | 32 +++++---
 .../staging/media/sunxi/cedrus/cedrus_hw.c    | 14 +++-
 .../staging/media/sunxi/cedrus/cedrus_mpeg2.c | 74 ++++++++++++++++---
 .../staging/media/sunxi/cedrus/cedrus_regs.h  |  8 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c | 15 ++--
 .../staging/media/sunxi/cedrus/cedrus_video.h |  5 ++
 .../staging/media/sunxi/cedrus/cedrus_vp8.c   | 72 +++++++++++++++++-
 10 files changed, 329 insertions(+), 46 deletions(-)

base-commit: 27285b099fbc5cb2ae3aef20f3bbd7b3c88b3005

Signature · 1 line
2.43.0