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=1795906160; b=rTBj4YtHUqcqCCikZXm1Ok+TSAgB+JQEhtQTuDdKvuV4iDwmNSlBn4AlkQIfoDbx8egF aN6+hl1GaQwafjSp10KQDqn41ya96/6qSAhfZ2pXuhfC0JpP7GpfzthTRvGmmTQRh0Liv p7vf8MvJx5ULDfCKCK+fWTFvUEkDrXV61tbYl38sufv0G95TYH1Koo1IhKrQSRCGsT+Q6 2VjId1Q3JiEyU+4iSH8ac2mLnA5xqrIbnsua708pOt9OpCPDLwCq1bY0wBKcuBfNkXo+J 8uvugorH2i37IfYODyIMoqeCh71jAXnwl+XkTGH6SvbiAtHtx4Ck594CL3Fu048MkKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795906160; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Uroldfmw3wY+SIr6K8cLQQeng1t3NsK/+29X0o+4L8s=; b=vfBz9lh+adBAN3tyZbut5ZslqTdrRq0+m/djI6h+nbM0mIh7fXbVMZU7wq0RFbSzHciX UZi1+0pQ1ih0WXxF+GuLprf+/GiTz/j3K2FjfsKPKwugsTbXY0KZY6MtQnAgBEyvr1BcE 6nHSEm2Sd2OSyvljWkAmBiIYkK7h6/cDghhZk4XKJCmyiOH1n7ZwbAu9jfUq4Q0vApEeK /BobJRxJXCir0QGXWNFEeIZm1sx3xgH+j5UrBz31FoZ6o4w8YSHJxUXtzDjXBiuce+VOe UmXJfG5kfzgK7M3m3WAJ29rnikjCuWP/48heGGu6Oe0cJ7gJQba4QSoyCk5aegjZXPA== 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=SGVOA7dR; 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 1037F606A31C for ; Sat, 28 Nov 2026 22:49:19 +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=SGVOA7dR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E8B61F00893; Sat, 28 Nov 2026 22:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795906159; bh=Uroldfmw3wY+SIr6K8cLQQeng1t3NsK/+29X0o+4L8s=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=SGVOA7dRxtp4AtY3R5L2FwLlnAX21EsMbozGcQUPhHP6m7RpAveJEap70AO7XoCLP QhKo7UM0BRsIu5etBDuVekovNTfI1ew/1FhKTvWwqoqqn9agEY5cQ9hQ70G9U3gDVx EZ6Kj1samim6UcSPF/FriGlDKsmMqymvkbAKKo/K9EgyWvU33mZizciDkJzBzvnFI8 mGgjbSbnIR4HXegYIcChUeAK8KEgGYk4e+Ie4arWXyBXX6j+IAOuQnhCWgb5aE37eM Fpahg4oisZCw5GQ9pyh/H7H3sMNsTu/+0wIWw5C+ATlRnyWfiuFSaKBsEJQL/PG85f QFQOT75tu8j7A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 08/17] media: apple: avd: add vp9 support 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-8-35ad7d52c842@icloud.com> References: <20261128-avd-v4-0-35ad7d52c842@icloud.com> <20261128-avd-v4-8-35ad7d52c842@icloud.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 28 Nov 2026 22:49:18 +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 8 potential issues to consider: - [High] media: apple: avd: scratch buffer sizing mismatch in avd_vp9_alloc_bufs() - [High] media: apple: avd: tile end coordinate underflow in set_tiles() - [Medium] media: apple: avd: broken VP9_REF_SEL_ALT deduplication in make_flags1() - [Medium] media: apple: avd: race between avd_submit_job() and avd_run_postamble() - [Medium] media: apple: avd: uninitialized vp9 ref dimensions in set_refs() - [Medium] media: apple: avd: missing try_ctrl and invalid format mapping in avd-vp9 - [Medium] media: apple: avd: stale VP9 controls used when avd_s_ctrl() returns -EBUSY - [Medium] media: apple: avd: wrong segmentation and ref flags in make_flags1() -- commit 3ff91a4acc8c11fb58895e9ab8c779033b9d3352 Author: Sofus Forstreuter media: apple: avd: add vp9 support This commit adds stateless V4L2 VP9 decoding support to the Apple Video Decoder (AVD) driver. > diff --git a/drivers/media/platform/apple/avd/avd-v4l2.c b/drivers/media/= platform/apple/avd/avd-v4l2.c > index 19fee769b3c0c..d4ed64756c335 100644 > --- a/drivers/media/platform/apple/avd/avd-v4l2.c > +++ b/drivers/media/platform/apple/avd/avd-v4l2.c > @@ -265,6 +265,29 @@ static const struct avd_ctrls avd_h264_ctrls =3D { > .num_ctrls =3D ARRAY_SIZE(avd_h264_ctrl_descs), > }; > =20 > +static const struct avd_ctrl_desc avd_vp9_ctrl_descs[] =3D { > + { > + .cfg.id =3D V4L2_CID_STATELESS_VP9_FRAME, > + .cfg.ops =3D &avd_ctrl_ops, > + }, [Severity: Medium] Can applying per-frame request controls fail in avd_s_ctrl() and leave avd_vp9_run_preamble() reading stale or zeroed ctrl->p_cur.p values? V4L2_CID_STATELESS_VP9_FRAME is submitted in every frame's media request. If userspace allocates CAPTURE buffers before issuing a non-request VIDIOC_S_EXT_CTRLS(V4L2_CID_STATELESS_VP9_FRAME) (so ctx->image_fmt is still AVD_IMG_FMT_ANY), or if a request changes bit_depth or subsampling while CAPTURE buffers are allocated, v4l2_ctrl_request_setup() calls avd_s_ctrl() during avd_run_preamble(): drivers/media/platform/apple/avd/avd-v4l2.c:avd_s_ctrl() { ... image_fmt =3D desc->ops->get_image_fmt(ctx, ctrl); if (avd_image_fmt_changed(ctx, image_fmt)) { vq =3D v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); if (vb2_is_busy(vq)) return -EBUSY; ... } When avd_s_ctrl() returns -EBUSY, v4l2_ctrl_request_setup() aborts before updating ctrl->p_cur on V4L2_CID_STATELESS_VP9_FRAME and before applying V4L2_CID_STATELESS_VP9_COMPRESSED_HDR. Because avd_run_preamble() ignores the return value of v4l2_ctrl_request_setup(), avd_vp9_run_preamble() proceeds to decode the new bitstream with the previous frame's parameters and probability updates. > diff --git a/drivers/media/platform/apple/avd/avd-vp9.c b/drivers/media/p= latform/apple/avd/avd-vp9.c > new file mode 100644 > index 0000000000000..822de33d6a512 > --- /dev/null > +++ b/drivers/media/platform/apple/avd/avd-vp9.c [ ... ] > +static void set_refs(struct avd_ctx *ctx, struct avd_vp9_run *run) > +{ > + const struct v4l2_ctrl_vp9_frame *frame =3D run->decode_params; > + struct avd_decoded_buffer *dst, *ref_buf[4]; > + int xscale, yscale; > + > + dst =3D vb2_to_avd_decoded_buf(&run->base.bufs.dst->vb2_buf); > + > + ref_buf[0] =3D avd_get_ref_buf(ctx, &dst->base.vb, frame->last_frame_ts= ); > + ref_buf[1] =3D > + avd_get_ref_buf(ctx, &dst->base.vb, frame->golden_frame_ts); > + ref_buf[2] =3D avd_get_ref_buf(ctx, &dst->base.vb, frame->alt_frame_ts); > + > + push(0, ""); > + push(0, ""); > + push(0, ""); > + > + for (int i =3D 0; i < V4L2_VP9_NUM_FRAME_CTX - 1; i++) { > + push(AVD_REF_FLAG_CONST, "hdr_9c_ref_100"); > + push(AVD_HDR_HEIGHT(ref_buf[i]->vp9.height - 1) | > + AVD_HDR_WIDTH(ref_buf[i]->vp9.width - 1), > + "hdr_70_ref_height_width"); [Severity: Medium] Can ref_buf[i]->vp9.height - 1 and ref_buf[i]->vp9.width - 1 underflow to 0xffff here if an earlier decode job failed on that capture buffer? In avd_vp9_run(), avd_vp9_run_preamble() calls avd_run_preamble() first, which copies the source timestamp to the destination buffer and sets copied_timestamp =3D 1 before validate_dec_params() and avd_init_job() run. If either check fails on a newly allocated capture buffer, avd_vp9_run() jumps to postamble before update_dec_buf_info() populates dst->vp9.width and dst->vp9.height. A subsequent inter frame referencing that timestamp will match the failed buffer via avd_get_ref_buf() with width and height still 0, programming 65536x65536 reference dimensions and zero scale factors into the hardware command stream. > + > + xscale =3D (ref_buf[i]->vp9.width << VP9_REF_SCALE_SHIFT) / > + dst->vp9.width; > + yscale =3D (ref_buf[i]->vp9.height << VP9_REF_SCALE_SHIFT) / > + dst->vp9.height; > + push(AVD_HDR_HEIGHT(xscale) | AVD_HDR_WIDTH(yscale), > + "ref_scale"); > + > + push_comp(ctx, ref_buf[i]); > + } > +} > + > +static u32 make_flags1(struct avd_ctx *ctx, struct avd_vp9_run *run) > +{ > + struct avd_vp9_ctx *vp9_ctx =3D ctx->priv; > + const struct v4l2_ctrl_vp9_frame *frame =3D run->decode_params; > + struct avd_decoded_buffer *dst, *last, *golden, *alt; > + > + dst =3D vb2_to_avd_decoded_buf(&run->base.bufs.dst->vb2_buf); > + last =3D avd_get_ref_buf(ctx, &dst->base.vb, frame->last_frame_ts); > + golden =3D avd_get_ref_buf(ctx, &dst->base.vb, frame->golden_frame_ts); > + alt =3D avd_get_ref_buf(ctx, &dst->base.vb, frame->alt_frame_ts); > + u32 flags; > + > + /* > + * i have only seen V4L2_VP9_SIGN_BIAS_ALT, im simply guessing the > + * same applies for last and golden > + */ > + flags =3D VP9_REF_SEL_LAST(VP9_LAST_FRAME); > + > + flags |=3D VP9_REF_BIAS_LAST(frame->ref_frame_sign_bias & > + V4L2_VP9_SIGN_BIAS_LAST); > + flags |=3D VP9_REF_SEL_GOLDEN(golden =3D=3D last ? VP9_LAST_FRAME : > + VP9_GOLDEN_FRAME); > + flags |=3D VP9_REF_BIAS_GOLDEN(frame->ref_frame_sign_bias & > + V4L2_VP9_SIGN_BIAS_GOLDEN); > + flags |=3D VP9_REF_SEL_ALT(alt !=3D golden ? VP9_ALTREF_FRAME : > + alt !=3D last ? VP9_GOLDEN_FRAME : > + VP9_LAST_FRAME); [Severity: Medium] Does VP9_REF_SEL_ALT select VP9_ALTREF_FRAME instead of VP9_LAST_FRAME when alt =3D=3D last and golden !=3D last? Testing alt !=3D golden first immediately evaluates to VP9_ALTREF_FRAME whenever alt and golden differ, so the alt =3D=3D last case is only reached when alt =3D=3D golden =3D=3D last. Checking alt =3D=3D last ? VP9_LAST_FR= AME : (alt =3D=3D golden ? VP9_GOLDEN_FRAME : VP9_ALTREF_FRAME) would deduplicate against both earlier reference slots. > + flags |=3D VP9_REF_BIAS_ALT(frame->ref_frame_sign_bias & > + V4L2_VP9_SIGN_BIAS_ALT); > + > + flags |=3D VP9_REFERENCE_MODE(frame->reference_mode); > + > + flags |=3D VP9_PARALLEL_DEC(frame->flags & > + V4L2_VP9_FRAME_FLAG_PARALLEL_DEC_MODE); > + flags |=3D VP9_REFRESH_CTX(frame->flags & > + V4L2_VP9_FRAME_FLAG_REFRESH_FRAME_CTX); > + flags |=3D VP9_INTERP_FILTER(frame->interpolation_filter); > + flags |=3D VP9_HIGH_PREC_MV(frame->flags & > + V4L2_VP9_FRAME_FLAG_ALLOW_HIGH_PREC_MV); > + > + flags |=3D > + VP9_ERR_RES(frame->flags & V4L2_VP9_FRAME_FLAG_ERROR_RESILIENT); > + > + flags |=3D VP9_SEG_ABS(frame->seg.flags & > + V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE); > + flags |=3D VP9_SEG_UDATA_TEMP( > + frame->seg.flags & V4L2_VP9_SEGMENTATION_FLAG_UPDATE_DATA && > + frame->seg.flags & V4L2_VP9_SEGMENTATION_FLAG_TEMPORAL_UPDATE); > + flags |=3D VP9_SEG_UPDATE_MAP(frame->seg.flags & > + V4L2_VP9_SEGMENTATION_FLAG_UPDATE_MAP); > + flags |=3D VP9_SEG_ENABLED(frame->seg.flags & > + V4L2_VP9_SEGMENTATION_FLAG_ENABLED); > + > + flags |=3D VP9_HAS_REF( > + !(frame->flags & V4L2_VP9_FRAME_FLAG_ERROR_RESILIENT) && > + !(frame->flags & V4L2_VP9_FRAME_FLAG_KEY_FRAME) && > + vp9_ctx->last.valid && > + vp9_ctx->last.flags & V4L2_VP9_FRAME_FLAG_SHOW_FRAME && > + !(vp9_ctx->last.flags & V4L2_VP9_FRAME_FLAG_KEY_FRAME)); [Severity: Medium] Should VP9_SEG_UDATA_TEMP be gated on V4L2_VP9_SEGMENTATION_FLAG_UPDATE_MAP rather than V4L2_VP9_SEGMENTATION_FLAG_UPDATE_DATA, and should VP9_HAS_REF also exclude V4L2_VP9_FRAME_FLAG_INTRA_ONLY? In the VP9 specification (sections 6.2.11 and 6.4.14), segmentation_temporal_update is a sub-flag of segmentation_update_map and is independent of segmentation_update_data; when a frame temporally updates the segment map while reusing existing feature data, leaving VP9_SEG_UDATA_TEMP cleared causes the hardware boolean decoder to misparse segment IDs. In addition, VP9_HAS_REF only checks for V4L2_VP9_FRAME_FLAG_KEY_FRAME on frame->flags and vp9_ctx->last.flags, even though intra-only frames cannot use or provide temporal MV references (and set_header() skips set_refs() when V4L2_VP9_FRAME_FLAG_INTRA_ONLY is set). [ ... ] > +static int set_tiles(struct avd_ctx *ctx, struct avd_vp9_run *run) > +{ [ ... ] > + /* 6.2.6 Compute image size syntax */ > + u32 sb_64_cols =3D (((frame->frame_width_minus_1 + 8) >> 3) + 7) >> 3; > + u32 sb_64_rows =3D (((frame->frame_height_minus_1 + 8) >> 3) + 7) >> 3; > + > + for (int row =3D 0; row < num_tile_rows; row++) > + for (int col =3D 0; col < num_tile_cols; col++) { > + if (row =3D=3D num_tile_rows - 1 && > + col =3D=3D num_tile_cols - 1) { > + tile_size =3D size; > + } else { > + if (size < 4) > + return -EINVAL; > + tile_size =3D get_unaligned_be32(&data[offset]); > + if (tile_size > size - 4) > + return -EINVAL; > + offset +=3D 4; > + size -=3D 4; > + } > + > + coded_in =3D run->base.coded_in + offset; > + push(AVD_OP_CODED_DATA | AVD_OP_CODED_IN_HI(coded_in), > + "cm3_cmd_set_slice_data"); > + push(AVD_OP_CODED_IN_LO(coded_in), "coded_in"); > + push(tile_size, "til_ab8_tile_size"); > + push(AVD_OP_SL_DIM_START | > + AVD_OP_SL_DIM_START_Y((row * sb_64_rows) / > + num_tile_rows) | > + AVD_OP_SL_DIM_START_X((col * sb_64_cols) / > + num_tile_cols), > + "i"); > + > + push(AVD_SL_DIM_END_COL(col) | > + AVD_SL_DIM_END_Y(((row + 1) * sb_64_rows) / > + num_tile_rows - 1) | > + AVD_SL_DIM_END_X(((col + 1) * sb_64_cols) / > + num_tile_cols - 1), > + "til_ac0_tile_dims"); [Severity: High] Can ((row + 1) * sb_64_rows) / num_tile_rows - 1 and ((col + 1) * sb_64_cols) / num_tile_cols - 1 underflow when num_tile_rows > sb_64_rows or num_tile_cols > sb_64_cols? validate_vp9_frame() allows tile_rows_log2 up to 2 (num_tile_rows =3D 4) and tile_cols_log2 up to 6 (num_tile_cols =3D 64) regardless of frame size, and validate_dec_params() allows frames down to 64x64 (sb_64_rows =3D 1, sb_64_cols =3D 1). When num_tile_rows > sb_64_rows or num_tile_cols > sb_64_cols, the integer division at row =3D 0 or col =3D 0 evaluates to 0 a= nd subtracting 1 underflows to 0xfff in AVD_SL_DIM_END_Y or AVD_SL_DIM_END_X. [ ... ] > +static int validate_dec_params(struct avd_ctx *ctx, > + const struct v4l2_ctrl_vp9_frame *dec_params) > +{ > + unsigned int aligned_width, aligned_height; > + > + if (dec_params->bit_depth > 10) > + /* not implemented */ > + return -EINVAL; > + > + if (dec_params->profile =3D=3D 1 || dec_params->profile > 2) > + return -EINVAL; > + > + if (dec_params->frame_height_minus_1 + 1 < 64 || > + dec_params->frame_width_minus_1 + 1 < 64) > + return -EINVAL; > + > + aligned_width =3D round_up(dec_params->frame_width_minus_1 + 1, 64); > + aligned_height =3D round_up(dec_params->frame_height_minus_1 + 1, 16); > + > + /* > + * Userspace should update the capture/decoded format when the > + * resolution changes. > + */ > + if (aligned_width !=3D ctx->decoded_fmt.fmt.pix_mp.width || > + aligned_height !=3D ctx->decoded_fmt.fmt.pix_mp.height) { > + dev_err(ctx->dev->dev, > + "unexpected bitstream resolution %dx%d\n", > + aligned_width, aligned_height); > + return -EINVAL; > + } > + > + return 0; > +} > + > +static int avd_vp9_alloc_bufs(struct avd_ctx *ctx) > +{ > + struct avd_dev *avd =3D ctx->dev; > + struct avd_vp9_ctx *vp9_ctx =3D ctx->priv; > + int ret, w, h, bit_depth; > + > + w =3D fmt_width(ctx); > + h =3D fmt_height(ctx); > + bit_depth =3D (ctx->image_fmt =3D=3D AVD_IMG_FMT_420_10BIT || > + ctx->image_fmt =3D=3D AVD_IMG_FMT_422_10BIT) ? > + 10 : > + 8; [Severity: High] Can the hardware write past the end of the scratch DMA buffers in vp9_ctx->bufs when ctx->decoded_fmt or dec_params->bit_depth exceeds the OUTPUT format dimensions or ctx->image_fmt used at OUTPUT STREAMON? avd_vp9_alloc_bufs() runs only once when VIDIOC_STREAMON is called on the OUTPUT queue, sizing color, ip_above, lf_above, seg, lf_left, lf_left_info, az_left, and above_info from ctx->coded_fmt (fmt_width(ctx) and fmt_height(ctx)) and ctx->image_fmt. However, avd_try_capture_fmt() allows ctx->decoded_fmt on the CAPTURE queue to be larger than ctx->coded_fmt (including after a mid-stream CAPTURE resolution change while OUTPUT remains streaming), and VIDIOC_STREAMON(OUTPUT) can run while ctx->image_fmt is still AVD_IMG_FMT_ANY (allocating for bit_depth =3D 8) before a 10-bit frame is submitted. Because validate_dec_params() only checks aligned_width and aligned_height against ctx->decoded_fmt and allows any dec_params->bit_depth <=3D 10, set_header() will program the hardware for dimensions or a 10-bit depth larger than the allocated scratch buffers. [ ... ] > +static int avd_vp9_run(struct avd_ctx *ctx) > +{ [ ... ] > + set_header(ctx, &run); > + avd_end_segment(ctx, false); > + ret =3D set_tiles(ctx, &run); > + if (ret) > + goto postamble; > + > + ret =3D avd_submit_job(ctx); > + > +postamble: > + avd_run_postamble(ctx, &run.base); > + return ret; > +} [Severity: Medium] Can avd_irq_handler() finish the job before avd_run_postamble() runs, leaving the media request uncompleted? CPU0 CPU1 avd_vp9_run() avd_submit_job() writel(..., AVD_REG_MBOX1_SUBMIT) avd_irq_handler() avd_job_finish() ... vb2_buffer_done() media_request_object_unbind() obj->req =3D NULL avd_run_postamble() src_req =3D ...->req_obj.req if (src_req) <-- NULL, skips v4l2_ctrl_request_complete() When vb2_buffer_done() unbinds the source buffer first, run.base.bufs.src->vb2_buf.req_obj.req becomes NULL before avd_run_postamble() reads it, so v4l2_ctrl_request_complete() is skipped and the media request never completes. Calling avd_run_postamble() before avd_submit_job() (or saving and completing the request before kicking off the hardware) avoids this race. [ ... ] > +static enum avd_image_fmt avd_vp9_get_image_fmt(struct avd_ctx *ctx, > + struct v4l2_ctrl *ctrl) > +{ > +#define BIT_DEPTH(chroma) \ > + (frame->bit_depth =3D=3D 8 ? AVD_IMG_FMT_##chroma##_8BIT : \ > + AVD_IMG_FMT_##chroma##_10BIT) > + const struct v4l2_ctrl_vp9_frame *frame =3D ctrl->p_new.p_vp9_frame; > + > + if (ctrl->id !=3D V4L2_CID_STATELESS_VP9_FRAME) > + return AVD_IMG_FMT_ANY; > + > + /* 7.2.2 Color config semantics */ > + if (frame->flags & V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING) { > + if (frame->flags & V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING) > + return BIT_DEPTH(420); > + else > + return BIT_DEPTH(422); > + } > + > + return AVD_IMG_FMT_ANY; > +#undef BIT_DEPTH > +} > + > +const struct avd_coded_fmt_ops avd_vp9_fmt_ops =3D { > + .start =3D avd_vp9_start, > + .stop =3D avd_vp9_stop, > + .run =3D avd_vp9_run, > + .done =3D avd_vp9_done, > + .get_image_fmt =3D avd_vp9_get_image_fmt, > +}; [Severity: Medium] Should avd_vp9_fmt_ops implement .try_ctrl to reject unsupported profiles, bit depths, subsampling, and dimensions at control validation time, and should avd_vp9_get_image_fmt() avoid mapping 4:2:2 or 12-bit frames to supported CAPTURE formats? Without .try_ctrl, VIDIOC_TRY_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, and MEDIA_REQUEST_IOC_VALIDATE accept VP9 profile 1/3, 12-bit, 4:2:2, and sub-64x64 frames, and avd_vp9_get_image_fmt() maps 4:2:2 and 12-bit frames to AVD_IMG_FMT_422_* and 10-bit CAPTURE formats even though set_header() hardcodes 4:2:0 (AVD_HDR_COMMON_CHROMA_FORMAT(1)) and validate_dec_params() rejects profile 1, profile > 2, and bit_depth > 10 when the decode job runs. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261128-avd-v4-0-3= 5ad7d52c842@icloud.com?part=3D8