Skip to content

Commit d64e6fb

Browse files
committed
media: rpi: hevc_dec: allow up to 64 capture buffers
The capture queue does not set max_num_buffers, so videobuf2 limits it to VB2_MAX_FRAME (32) buffers, and the per-buffer auxiliary (colocated motion vector) table is sized to match. Every reference frame must be a capture buffer, so a userspace that keeps decoded frames queued for display or further processing can exhaust that limit, and VIDIOC_CREATE_BUFS then fails with -ENOBUFS. Kodi's Dolby Vision profile 7 FEL playback holds up to 16 base layer pictures while it waits for the matching enhancement layer pictures, on top of the HEVC DPB and its render queue, which exceeds 32 buffers for the 4K base layer. Size the auxiliary table for 64 entries and allow 64 capture buffers. Buffers and their auxiliary data are still allocated on demand, and the decoder is behind an IOMMU, so they do not use CMA. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
1 parent 013e30f commit d64e6fb

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/media/platform/raspberrypi/hevc_dec/hevc_d.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct hevc_d_dev;
9494
typedef void (*hevc_d_irq_callback)(struct hevc_d_dev *dev, void *ctx);
9595

9696
struct hevc_d_q_aux;
97-
#define HEVC_D_AUX_ENT_COUNT VB2_MAX_FRAME
97+
#define HEVC_D_AUX_ENT_COUNT 64
9898

9999
struct hevc_d_ctx {
100100
struct v4l2_fh fh;

‎drivers/media/platform/raspberrypi/hevc_dec/hevc_d_video.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ int hevc_d_queue_init(void *priv, struct vb2_queue *src_vq,
642642
dst_vq->drv_priv = ctx;
643643
dst_vq->buf_struct_size = sizeof(struct hevc_d_buffer);
644644
dst_vq->min_queued_buffers = 1;
645+
dst_vq->max_num_buffers = HEVC_D_AUX_ENT_COUNT;
645646
dst_vq->ops = &hevc_d_qops;
646647
dst_vq->mem_ops = &vb2_dma_contig_memops;
647648
dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;

0 commit comments

Comments
 (0)