From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795905593; b=Lx3YGziooqr8Y27SeIHJUjYGWqAF0mcUFJxgZ+CY1V+bRZsSY+CQ4gAqh8+/svHysPF5 SSFrtpHR3ve6ITHXlscSRCo+Eh+2xq7w7FWyRyq8fQQ6M4gLiNdHImTN0gMUHRktKL6QN YjLjmjq7v423As2VlhI+BTXo1cJhGzMNFyJB+jBDKid1A7QAK9QL1OrrnMLGrtLXob7wo 4mM6NlH0SMbCm6lURXwJg54wan+xIwijHMdLrMb45CD1DbpDKGPrMCTyhFV4CFihLZc4O BGE58nON6uPoby0HSOMOXWvXW5LAt2Ufdm5k+oCN2/vs8luxjrsJXBv79IcMn8K0qgA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795905593; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=AZe84VBBkJ3kKEEQWRw7ttql8t0JTTdrnKPhH56PAtQ=; b=FpCaW9+dzUF9Xy0ZLkwQp90KlqcHERMsy1f/X67EJ5dINod1idUaK9IRzgbokd59DzIJ aE4FZcErj2vgMb3T0G2SxgU1qnC/iBy2YUXyKamdEFM2hUE92GLk6Ar081DmfmVSTsPqS qReeg/8FDSBNs2KGFo5hNJtrhgy+iEnv9FRpOlbl1g2z88GgxsDBXJjwCbiDXIKJWAvGs HHDgJ1u4yd+nJOBmm4f+uy1SCtKxb2Gsr19oJR3k0zr14ViwmvggJCe1utZUAwn3Iz+BC qBYNoH9b/B6qg4BO7lA5oLV89C9wCzxDADhOs5OlzCHY6GIC7jzBx8V5RO43AZVQelg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PfOcfEVp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 027F8606A31C for ; Sat, 28 Nov 2026 22:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PfOcfEVp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6029D1F000C1; Sat, 28 Nov 2026 22:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795905592; bh=AZe84VBBkJ3kKEEQWRw7ttql8t0JTTdrnKPhH56PAtQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=PfOcfEVpI14T8+qeXxwME1x7TIv8J9yCFgT07S2kH7NQfHBg1+r6ARXQ342fH1bdu GQOgiRBcKK+hw1lOUk2HIogxwx3KsjU1AgA/FLUCooZSUfw9rk1+0aa1A9aM2DZtXi pbFFhDwc4X+N2Fbd73SErDC6S/yCu5I0vji8AI68pGobyzV9X5BsTI0OAuA7nHub9m 0lvaCDmlVRuypw3gRFx//bKGelivpYYYqeqRL6Iyz08YCAnRSfTMSgyxwMLsUWt3lG hE6N34gZp8JAl1o8685MgXcd28iO9eZNQRF8V28nauRAo8HkCSU/rD3ey2tpT76wIJ vDo/Q3RiA0ohw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 04/17] media: v4l2-ctrls: validate AV1 context_update_tile_id Reply-To: sashiko-reviews@lists.linux.dev To: "Sofus Forstreuter" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, media-ci@linuxtv.org In-Reply-To: <20261128-avd-v4-4-35ad7d52c842@icloud.com> References: <20261128-avd-v4-0-35ad7d52c842@icloud.com> <20261128-avd-v4-4-35ad7d52c842@icloud.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 28 Nov 2026 22:39:52 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 > media: v4l2-ctrls: validate AV1 context_update_tile_id >=20 > Increase V4L2_AV1_MAX_TILE_COUNT to MAX_TILE_COLS * MAX_TILE_ROWS >=20 > Reviewed-by: Neal Gompa > Signed-off-by: Sofus Forstreuter [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 >=3D 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261128-avd-v4-0-3= 5ad7d52c842@icloud.com?part=3D4