[PATCH v3 0/7] media: verisilicon: simplify auxiliary buffers allocation

Benjamin Gaignard benjamin.gaignard at collabora.com
Mon Nov 23 01:58:58 PST 2026


Verisilicon stateless video decoder driver allocates lot of auxiliary
buffers to decode bitstreams. These allocations duplicate a lot of code.
This series add helpers functions to allocate and free auxiliary
buffers. This simplify the driver code and will allow to implement more
easly incoming feature like disentanglement data buffers from mv and rfc 
buffers or adding reference frame support for more codecs.

This series has been tested with fluster on IMX8MP for h264, hevc, vp8 
and vp9 codecs, and on rk3588 for av1.

This series depends of this one:
https://patchwork.linuxtv.org/project/linux-media/list/?series=34366

Regards,
Benjamin

changes in v3:
- As suggested by Philipp do not mask hantro_allocate_aux_buf() returned
  value.
- In hantro_allocate_aux_buf() and hantro_free_aux_buf() only set vpu if
  ctx isn't NULL.

changes in v2:
- rebase on top of media: verisilicon: Create AV1 helper library v7
- tag reviewed-by tag
- fix patch 1 and 7 commit messages

 
Benjamin Gaignard (7):
  media: verisilicon: Add helpers to allocate and free auxiliary buffers
  media: verisilicon: AV1: Use alloc/free helpers for auxiliary buffers
  media: verisilicon: h264: Use alloc/free helpers for auxiliary buffers
  media: verisilicon: hevc: Use alloc/free helpers for auxiliary buffers
  media: verisilicon: vp8: Use alloc/free helpers for auxiliary buffers
  media: verisilicon: vp9: Use alloc/free helpers for auxiliary buffers
  media: verisilicon: mpeg4: Use alloc/free helpers for auxiliary
    buffers

 drivers/media/platform/verisilicon/hantro.h   |   4 +
 .../media/platform/verisilicon/hantro_av1.c   | 191 +++++-------------
 .../media/platform/verisilicon/hantro_h264.c  |  13 +-
 .../media/platform/verisilicon/hantro_hevc.c  | 133 ++++--------
 .../media/platform/verisilicon/hantro_mpeg2.c |  19 +-
 .../platform/verisilicon/hantro_postproc.c    |  21 +-
 .../media/platform/verisilicon/hantro_v4l2.c  |  37 ++++
 .../media/platform/verisilicon/hantro_vp8.c   |  36 +---
 .../media/platform/verisilicon/hantro_vp9.c   |  42 ++--
 9 files changed, 169 insertions(+), 327 deletions(-)

-- 
2.53.0




More information about the Linux-rockchip mailing list