From: sashiko-bot@kernel.org
To: "Sofus Forstreuter" <sofus.c@icloud.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
media-ci@linuxtv.org
Subject: Re: [PATCH v4 04/17] media: v4l2-ctrls: validate AV1 context_update_tile_id
Date: Sat, 28 Nov 2026 22:39:52 +0000 [thread overview]
Message-ID: <sashiko-outbox-239113@kernel.org> (raw)
In-Reply-To: <20261128-avd-v4-4-35ad7d52c842@icloud.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] media: v4l2-ctrls: V4L2_AV1_MAX_TILE_COUNT increase inflates
mtk buffers 8x
- [Low] media: v4l2-ctrls: incomplete changelog for AV1 tile init and
max tile count
--
commit aa08fd69f876d8214a79152486ea6debf2235ddc
Author: Sofus Forstreuter <sofus.c@icloud.com>
> media: v4l2-ctrls: validate AV1 context_update_tile_id
>
> Increase V4L2_AV1_MAX_TILE_COUNT to MAX_TILE_COLS * MAX_TILE_ROWS
>
> Reviewed-by: Neal Gompa <neal@gompa.dev>
> Signed-off-by: Sofus Forstreuter <sofus.c@icloud.com>
[Severity: Low]
This isn't a bug, but the commit message does not explain why
context_update_tile_id is checked against tile_cols * tile_rows in
validate_av1_tile_info(), fails to mention initializing default tile_cols
and tile_rows to 1 in std_init_compound() so default controls pass that
check, and does not explain why V4L2_AV1_MAX_TILE_COUNT is increased in
the same commit.
> diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
> index d17e41d51d2ec..abdfa102a77bb 100644
> --- a/include/uapi/linux/v4l2-controls.h
> +++ b/include/uapi/linux/v4l2-controls.h
> @@ -2939,7 +2939,7 @@ struct v4l2_ctrl_vp9_compressed_hdr {
> #define V4L2_AV1_MAX_NUM_PLANES 3
> #define V4L2_AV1_MAX_TILE_COLS 64
> #define V4L2_AV1_MAX_TILE_ROWS 64
> -#define V4L2_AV1_MAX_TILE_COUNT 512
> +#define V4L2_AV1_MAX_TILE_COUNT 4096
[Severity: Medium]
Should V4L2_AV1_MAX_TILE_COUNT be raised to 4096?
With tile_cols and tile_rows already capped at 64 in
validate_av1_tile_info(), setting V4L2_AV1_MAX_TILE_COUNT to 64 * 64 turns
the (u32)t->tile_cols * t->tile_rows > V4L2_AV1_MAX_TILE_COUNT check into
dead code, while context_update_tile_id is a __u8 that cannot address tile
IDs >= 256.
In the MediaTek AV1 decoder, struct vdec_av1_slice_tile_group embeds two
u32[V4L2_AV1_MAX_TILE_COUNT] arrays inside struct vdec_av1_slice_instance,
so this 8x increase grows the kzalloc_obj(*instance) allocation in
vdec_av1_slice_init() from ~5.1 KB to ~33.8 KB (a costly order-4
physically contiguous allocation) and increases per-context coherent DMA
tile buffers in vdec_av1_slice_alloc_working_buffer() and
vdec_msg_queue_init() from 128 KB to 1 MB.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261128-avd-v4-0-35ad7d52c842@icloud.com?part=4
next prev parent reply other threads:[~2026-11-28 22:39 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 22:02 [PATCH v4 00/17] media: apple: add avd driver Sofus Forstreuter
2026-11-28 22:02 ` [PATCH v4 01/17] dt-bindings: media: add apple,avd Sofus Forstreuter
2026-11-28 22:08 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 02/17] media: v4l2: Add P210 pixel format Sofus Forstreuter
2026-11-28 22:02 ` [PATCH v4 03/17] media: v4l2: Add Apple interchange pixel formats Sofus Forstreuter
2026-11-28 22:02 ` [PATCH v4 04/17] media: v4l2-ctrls: validate AV1 context_update_tile_id Sofus Forstreuter
2026-11-28 22:39 ` sashiko-bot [this message]
2026-11-28 22:02 ` [PATCH v4 05/17] media: v4l2-ctrls: validate vp9 tile_rows_log2 Sofus Forstreuter
2026-11-28 22:08 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 06/17] media: apple: add avd driver Sofus Forstreuter
2026-11-28 22:42 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 07/17] media: apple: avd: add h264 support Sofus Forstreuter
2026-11-28 22:43 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 08/17] media: apple: avd: add vp9 support Sofus Forstreuter
2026-11-28 22:49 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 09/17] media: apple: avd: add hevc support Sofus Forstreuter
2026-11-28 22:46 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 10/17] media: apple: avd: add av1 support Sofus Forstreuter
2026-11-28 22:39 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 11/17] arm64: dts: apple: t8103: add avd nodes Sofus Forstreuter
2026-11-28 22:36 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 12/17] arm64: dts: apple: t8112: " Sofus Forstreuter
2026-11-28 22:21 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 13/17] arm64: dts: apple: t8122: " Sofus Forstreuter
2026-11-28 22:37 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 14/17] arm64: dts: apple: t600x: " Sofus Forstreuter
2026-11-28 22:35 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 15/17] arm64: dts: apple: t602x: " Sofus Forstreuter
2026-11-28 22:20 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 16/17] arm64: dts: apple: t6030: " Sofus Forstreuter
2026-11-28 22:42 ` sashiko-bot
2026-11-28 22:02 ` [PATCH v4 17/17] arm64: dts: apple: t6031: " Sofus Forstreuter
2026-11-28 22:42 ` sashiko-bot
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=sashiko-outbox-239113@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=media-ci@linuxtv.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sofus.c@icloud.com \
/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