From: Arun Iyengar via B4 Relay <devnull+aiyengar1990.gmail.com@kernel.org>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Andrzej Pietrasiewicz <andrzej.p@collabora.com>,
Hans Verkuil <hverkuil@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Arun Iyengar <aiyengar1990@gmail.com>
Subject: [PATCH v3 5/5] media: verisilicon: Set the bit depth again when its control is rewritten
Date: Mon, 30 Nov 2026 21:53:06 +0000 [thread overview]
Message-ID: <20261130-hantro-fixes-v3-5-5324f239c22e@gmail.com> (raw)
In-Reply-To: <20261130-hantro-fixes-v3-0-5324f239c22e@gmail.com>
From: Arun Iyengar <aiyengar1990@gmail.com>
S_FMT on OUTPUT resets the CAPTURE format to 8 bits, but rewriting an
unchanged 10-bit HEVC SPS, VP9 frame or AV1 sequence control skips
s_ctrl, so the format stays 8-bit. Mark these controls EXECUTE_ON_WRITE;
every write of them then also sends a V4L2_EVENT_CTRL value change.
Fixes: 3c32d94c9c52 ("media: verisilicon: Do not change context bit depth before validating the format")
Cc: stable@vger.kernel.org
Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
drivers/media/platform/verisilicon/hantro_drv.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 5c962847fdf5..aaafe13585a5 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -564,6 +564,7 @@ static const struct hantro_ctrl controls[] = {
.cfg = {
.id = V4L2_CID_STATELESS_HEVC_SPS,
.ops = &hantro_hevc_ctrl_ops,
+ .flags = V4L2_CTRL_FLAG_EXECUTE_ON_WRITE,
},
}, {
.codec = HANTRO_HEVC_DECODER,
@@ -585,6 +586,7 @@ static const struct hantro_ctrl controls[] = {
.cfg = {
.id = V4L2_CID_STATELESS_VP9_FRAME,
.ops = &hantro_vp9_ctrl_ops,
+ .flags = V4L2_CTRL_FLAG_EXECUTE_ON_WRITE,
},
}, {
.codec = HANTRO_VP9_DECODER,
@@ -607,6 +609,7 @@ static const struct hantro_ctrl controls[] = {
.cfg = {
.id = V4L2_CID_STATELESS_AV1_SEQUENCE,
.ops = &hantro_av1_ctrl_ops,
+ .flags = V4L2_CTRL_FLAG_EXECUTE_ON_WRITE,
},
}, {
.codec = HANTRO_AV1_DECODER,
@@ -621,6 +624,7 @@ static int hantro_ctrls_setup(struct hantro_dev *vpu,
int allowed_codecs)
{
int i, num_ctrls = ARRAY_SIZE(controls);
+ struct v4l2_ctrl *ctrl;
v4l2_ctrl_handler_init(&ctx->ctrl_handler, num_ctrls);
@@ -628,8 +632,8 @@ static int hantro_ctrls_setup(struct hantro_dev *vpu,
if (!(allowed_codecs & controls[i].codec))
continue;
- v4l2_ctrl_new_custom(&ctx->ctrl_handler,
- &controls[i].cfg, NULL);
+ ctrl = v4l2_ctrl_new_custom(&ctx->ctrl_handler,
+ &controls[i].cfg, NULL);
if (ctx->ctrl_handler.error) {
vpu_err("Adding control (%d) failed %d\n",
controls[i].cfg.id,
@@ -637,6 +641,9 @@ static int hantro_ctrls_setup(struct hantro_dev *vpu,
v4l2_ctrl_handler_free(&ctx->ctrl_handler);
return ctx->ctrl_handler.error;
}
+
+ /* v4l2_ctrl_new_custom() drops cfg.flags of standard controls. */
+ ctrl->flags |= controls[i].cfg.flags & V4L2_CTRL_FLAG_EXECUTE_ON_WRITE;
}
return v4l2_ctrl_handler_setup(&ctx->ctrl_handler);
}
--
2.55.0
prev parent reply other threads:[~2026-11-30 21:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 21:53 [PATCH v3 0/5] media: verisilicon: Keep the CAPTURE format in line with the decoder Arun Iyengar via B4 Relay
2026-11-30 21:53 ` [PATCH v3 1/5] media: verisilicon: Size the VP8 segment map for the largest frame Arun Iyengar via B4 Relay
2026-11-30 22:39 ` Nicolas Dufresne
2026-11-30 21:53 ` [PATCH v3 2/5] media: verisilicon: Set need_postproc before resetting the CAPTURE format Arun Iyengar via B4 Relay
2026-11-30 21:53 ` [PATCH v3 3/5] media: verisilicon: Size reference frames by the stream bit depth Arun Iyengar via B4 Relay
2026-11-30 21:53 ` [PATCH v3 4/5] media: verisilicon: Keep the CAPTURE format at the stream's " Arun Iyengar via B4 Relay
2026-11-30 21:53 ` Arun Iyengar via B4 Relay [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130-hantro-fixes-v3-5-5324f239c22e@gmail.com \
--to=devnull+aiyengar1990.gmail.com@kernel.org \
--cc=aiyengar1990@gmail.com \
--cc=andrzej.p@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=hverkuil@kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®