[PATCH v3 1/5] media: verisilicon: Keep the encoder CAPTURE format while buffers exist
From: Arun Iyengar via B4 Relay
Date: Thu Nov 26 2026 - 12:01:07 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
Commit bbd267daf4fc ("media: verisilicon: vp9: Allow to change
resolution while streaming") dropped the CAPTURE busy check in
hantro_set_fmt_cap() for decoders. On the encoder, CAPTURE is the coded
queue, so its sizeimage can now change under allocated buffers. Restore
the check for the encoder.
Fixes: bbd267daf4fc ("media: verisilicon: vp9: Allow to change resolution while streaming")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/media/platform/verisilicon/hantro_v4l2.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
index 83af9fa1ce94..0d6d4f36d012 100644
--- a/drivers/media/platform/verisilicon/hantro_v4l2.c
+++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
@@ -596,7 +596,12 @@ static int hantro_set_fmt_cap(struct hantro_ctx *ctx,
int ret;
if (ctx->is_encoder) {
- struct vb2_queue *peer_vq;
+ struct vb2_queue *vq, *peer_vq;
+
+ vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx,
+ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
+ if (vb2_is_busy(vq))
+ return -EBUSY;
/*
* Since format change on the CAPTURE queue will reset
--
2.55.0