From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
To: aiyengar1990@gmail.com,
Nicolas Dufresne <nicolas.dufresne@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
Subject: Re: [PATCH v2 2/4] media: verisilicon: Set need_postproc before resetting the CAPTURE format
Date: Mon, 23 Nov 2026 10:28:34 +0100 [thread overview]
Message-ID: <ad73cef4-0212-4749-8950-140dcfe4438c@collabora.com> (raw)
In-Reply-To: <20261115-hantro-fixes-v2-2-bfecfb07a3e7@gmail.com>
Le 15/11/2026 à 09:39, Arun Iyengar via B4 Relay a écrit :
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> hantro_reset_raw_fmt() sets bit_depth and need_postproc only after
> hantro_set_fmt_cap(), so hantro_try_fmt() sizes the format with the old
> values: after AV1 film grain is turned off, the CAPTURE buffers lack the
> motion vector area. Set them first and restore them on error.
>
> Fixes: 80c7373a456e ("media: verisilicon: Conditionally ignore native formats")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> drivers/media/platform/verisilicon/hantro_v4l2.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> index 83af9fa1ce94..5939fffc350d 100644
> --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> @@ -449,6 +449,8 @@ hantro_reset_raw_fmt(struct hantro_ctx *ctx, int bit_depth, bool need_postproc)
> {
> const struct hantro_fmt *raw_vpu_fmt;
> struct v4l2_pix_format_mplane raw_fmt, *encoded_fmt;
> + bool old_need_postproc = ctx->need_postproc;
> + int old_bit_depth = ctx->bit_depth;
> int ret;
>
> raw_vpu_fmt = hantro_get_default_fmt(ctx, false, bit_depth, need_postproc);
> @@ -465,14 +467,17 @@ hantro_reset_raw_fmt(struct hantro_ctx *ctx, int bit_depth, bool need_postproc)
> hantro_reset_fmt(&raw_fmt, raw_vpu_fmt);
> raw_fmt.width = encoded_fmt->width;
> raw_fmt.height = encoded_fmt->height;
> +
> + ctx->bit_depth = bit_depth;
> + ctx->need_postproc = need_postproc;
> if (ctx->is_encoder)
> ret = hantro_set_fmt_out(ctx, &raw_fmt, need_postproc);
> else
> ret = hantro_set_fmt_cap(ctx, &raw_fmt);
>
> - if (!ret) {
> - ctx->bit_depth = bit_depth;
> - ctx->need_postproc = need_postproc;
> + if (ret) {
> + ctx->bit_depth = old_bit_depth;
> + ctx->need_postproc = old_need_postproc;
> }
>
> return ret;
>
next prev parent reply other threads:[~2026-11-23 9:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 8:39 [PATCH v2 0/4] media: verisilicon: Keep the CAPTURE format in line with the decoder Arun Iyengar via B4 Relay
2026-11-15 8:39 ` [PATCH v2 1/4] media: verisilicon: Size the VP8 segment map for the largest frame Arun Iyengar via B4 Relay
2026-11-23 9:26 ` Benjamin Gaignard
2026-11-15 8:39 ` [PATCH v2 2/4] media: verisilicon: Set need_postproc before resetting the CAPTURE format Arun Iyengar via B4 Relay
2026-11-23 9:28 ` Benjamin Gaignard [this message]
2026-11-15 8:39 ` [PATCH v2 3/4] media: verisilicon: Keep the CAPTURE format at the stream's bit depth Arun Iyengar via B4 Relay
2026-11-15 8:39 ` [PATCH v2 4/4] media: verisilicon: Set the bit depth again when its control is rewritten Arun Iyengar via B4 Relay
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=ad73cef4-0212-4749-8950-140dcfe4438c@collabora.com \
--to=benjamin.gaignard@collabora.com \
--cc=aiyengar1990@gmail.com \
--cc=andrzej.p@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®