Re: [PATCH 2/5] media: iris: allow larger capture buffer pools on HFI gen2

From: Xilin Wu

Date: Fri Nov 27 2026 - 03:50:11 EST


On 11/4/2026 6:20 AM, Nicolas Dufresne wrote:
Le jeudi 29 octobre 2026 à 11:58 +0800, Xilin Wu a écrit :
VLC with VA-API frame threading can require more than the default vb2
limit of 32 CAPTURE buffers.

Raise the HFI gen2 decoder CAPTURE queue limit to 64 buffers.

Signed-off-by: Xilin Wu <sophon@xxxxxxxxx>
---
drivers/media/platform/qcom/iris/iris_vidc.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
index 05aab6e3005d..8c96b007b391 100644
--- a/drivers/media/platform/qcom/iris/iris_vidc.c
+++ b/drivers/media/platform/qcom/iris/iris_vidc.c
@@ -140,6 +140,9 @@ iris_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_
dst_vq->drv_priv = inst;
dst_vq->buf_struct_size = sizeof(struct iris_buffer);
dst_vq->min_reqbufs_allocation = MIN_BUFFERS;
+ if (inst->domain == DECODER &&
+ inst->core->iris_firmware_data == &iris_hfi_gen2_data)
+ dst_vq->max_num_buffers = DEFAULT_MAX_HOST_BUF_COUNT;

Why is this limited to decoders? Also, why not move the max into the firmware
data, so this code path can stay idiomatic.

Nicolas

The limit comes from the firmware: HFI gen2 decoders advertise OUTPUT_BUF_HOST_MAX_COUNT (HFI_PROP_BUFFER_HOST_MAX_COUNT = 64) on the CAPTURE port, while gen1 has no such property and the gen2 encoder caps only define it for the OUTPUT queue. In v2 I'll derive max_num_buffers from that capability when the platform provides it, instead of checking the firmware data pointer.

--
Best regards,
Xilin Wu <sophon@xxxxxxxxx>