From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Benjamin Gaignard <benjamin.gaignard@collabora.com>,
p.zabel@pengutronix.de, mchehab@kernel.org, heiko@sntech.de,
hverkuil@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH v9 2/4] media: verisilicon: Use V4L2_AV1_PRIMARY_REF_NONE and V4L2_AV1_REF_FRAME_INVALID
Date: Thu, 26 Nov 2026 21:03:26 -0500 [thread overview]
Message-ID: <f6e35a9c3f8240dba3ae413c52b9627f42a34b27.camel@collabora.com> (raw)
In-Reply-To: <20261125122825.236422-3-benjamin.gaignard@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 3243 bytes --]
Le mercredi 25 novembre 2026 à 13:28 +0100, Benjamin Gaignard a écrit :
> Use V4L2_AV1_PRIMARY_REF_NONE and V4L2_AV1_REF_FRAME_INVALID instead
> of local definition.
> Since ref_frame_idx[] values have been checked inside v4l2-ctrl-core.c
> remove the useless duplicate check.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> changes in v9:
> - Split core changes and drivers changes
> - Use V4L2_AV1_REF_FRAME_INVALID
>
> .../verisilicon/rockchip_vpu981_hw_av1_dec.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> index 2a145433e6d1..087a944b3394 100644
> --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> @@ -18,9 +18,7 @@
> #define AV1_TILE_INFO_SIZE (AV1_MAX_TILES * 16)
> #define AV1DEC_MAX_PIC_BUFFERS 24
> #define AV1_REF_SCALE_SHIFT 14
> -#define AV1_INVALID_IDX -1
> #define MAX_FRAME_DISTANCE 31
> -#define AV1_PRIMARY_REF_NONE 7
> #define AV1_TILE_SIZE ALIGN(32 * 128, 4096)
> /*
> * These 3 values aren't defined enum v4l2_av1_segment_feature because
> @@ -123,8 +121,8 @@ static int rockchip_vpu981_get_frame_index(struct hantro_ctx *ctx, int ref)
> u64 timestamp;
> int i, idx = frame->ref_frame_idx[ref];
>
> - if (idx >= V4L2_AV1_TOTAL_REFS_PER_FRAME || idx < 0)
> - return AV1_INVALID_IDX;
> + if (idx < 0)
> + return V4L2_AV1_REF_FRAME_INVALID;
>
> timestamp = frame->reference_frame_ts[idx];
> for (i = 0; i < AV1_MAX_FRAME_BUF_COUNT; i++) {
> @@ -134,7 +132,7 @@ static int rockchip_vpu981_get_frame_index(struct hantro_ctx *ctx, int ref)
> return i;
> }
>
> - return AV1_INVALID_IDX;
> + return V4L2_AV1_REF_FRAME_INVALID;
> }
>
> static int rockchip_vpu981_get_order_hint(struct hantro_ctx *ctx, int ref)
> @@ -142,7 +140,7 @@ static int rockchip_vpu981_get_order_hint(struct hantro_ctx *ctx, int ref)
> struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
> int idx = rockchip_vpu981_get_frame_index(ctx, ref);
>
> - if (idx != AV1_INVALID_IDX)
> + if (idx != V4L2_AV1_REF_FRAME_INVALID)
> return av1_dec->frame_refs[idx].order_hint;
>
> return 0;
> @@ -179,7 +177,7 @@ static int rockchip_vpu981_av1_dec_frame_ref(struct hantro_ctx *ctx,
> return i;
> }
>
> - return AV1_INVALID_IDX;
> + return V4L2_AV1_REF_FRAME_INVALID;
> }
>
> static void rockchip_vpu981_av1_dec_frame_unref(struct hantro_ctx *ctx, int idx)
> @@ -1256,7 +1254,7 @@ static void rockchip_vpu981_av1_dec_set_prob(struct hantro_ctx *ctx)
> bool frame_is_intra = IS_INTRA(frame->frame_type);
>
> if (error_resilient_mode || frame_is_intra ||
> - frame->primary_ref_frame == AV1_PRIMARY_REF_NONE) {
> + frame->primary_ref_frame == V4L2_AV1_PRIMARY_REF_NONE) {
> av1_dec->cdfs = &av1_dec->default_cdfs;
> av1_dec->cdfs_ndvc = &av1_dec->default_cdfs_ndvc;
> rockchip_av1_default_coeff_probs(quantization->base_q_idx,
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-11-27 2:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 12:28 [PATCH v9 0/4] media: verisilicon: Create AV1 helper library Benjamin Gaignard
2026-11-25 12:28 ` [PATCH v9 1/4] media: v4l2-ctrls: validate AV1 reference frame index Benjamin Gaignard
2026-11-27 2:03 ` Nicolas Dufresne
2026-11-25 12:28 ` [PATCH v9 2/4] media: verisilicon: Use V4L2_AV1_PRIMARY_REF_NONE and V4L2_AV1_REF_FRAME_INVALID Benjamin Gaignard
2026-11-27 2:03 ` Nicolas Dufresne [this message]
2026-11-25 12:28 ` [PATCH v9 3/4] media: verisilicon: AV1: Fix luma size Benjamin Gaignard
2026-11-25 12:28 ` [PATCH v9 4/4] media: verisilicon: Create AV1 helper library Benjamin Gaignard
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=f6e35a9c3f8240dba3ae413c52b9627f42a34b27.camel@collabora.com \
--to=nicolas.dufresne@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=heiko@sntech.de \
--cc=hverkuil@kernel.org \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
/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®