Dear Martin Blumenstingl:
Thanks for your patches! Unfortunately the Media CI robot detected some
issues:
# Test media-patchstyle:./0001-media-i2c-saa7115-only-select-SECAM-for-SECAM-only-s.patch media style
ERROR: Commit a9aaec4e83e687d23b78b38e331bbd6a10b96380 found in the stable tree, but stable(a)vger.kernel.org not in Cc:
WARNING: Non-standard signature: Assisted-by:
#48:
Assisted-by: Claude:claude-opus-5-5
ERROR: Unrecognized email address: 'Claude:claude-opus-5-5'
#48:
Assisted-by: Claude:claude-opus-5-5
total: 1 errors, 1 warnings, 25 lines checked
ERROR: Fails one or more mandatory checkpatch tests
# Test checkpatch:./0001-media-i2c-saa7115-only-select-SECAM-for-SECAM-only-s.patch checkpatch
WARNING: Non-standard signature: Assisted-by:
#48:
Assisted-by: Claude:claude-opus-5-5
ERROR: Unrecognized email address: 'Claude:claude-opus-5-5'
#48:
Assisted-by: Claude:claude-opus-5-5
total: 1 errors, 1 warnings, 0 checks, 25 lines checked
Please fix your series, and upload a new version. If you have a patchwork
account, do not forget to mark the current series as Superseded.
For more details, check the full report at:
https://linux-media.pages.freedesktop.org/-/users/patchwork/-/jobs/11617637… .
Best regards, and Happy Hacking!
Media CI robot on behalf of the linux-media community.
---
Check the latest rules for contributing your patches at:
https://docs.kernel.org/driver-api/media/maintainer-entry-profile.html
If you believe that the CI is wrong, kindly open an issue at
https://gitlab.freedesktop.org/linux-media/media-ci/-/issues or reply-all
to this message.
Dear Niklas Söderlund:
Thanks for your patches! Unfortunately the Media CI robot detected some
issues:
# Test checkpatch:./0001-media-uapi-videodev2-Add-20-bit-Bayer-formats.patch checkpatch
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#33:
new file mode 100644
WARNING: line length of 199 exceeds 100 columns
#149: FILE: drivers/media/v4l2-core/v4l2-common.c:405:
+{ .format = V4L2_PIX_FMT_SRGGB20,.pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
ERROR: trailing statements should be on next line
#161: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1437:
+case V4L2_PIX_FMT_SBGGR20:descr = "20-bit Bayer BGBG/GRGR"; break;
ERROR: trailing statements should be on next line
#162: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1438:
+case V4L2_PIX_FMT_SGBRG20:descr = "20-bit Bayer GBGB/RGRG"; break;
ERROR: trailing statements should be on next line
#163: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1439:
+case V4L2_PIX_FMT_SGRBG20:descr = "20-bit Bayer GRGR/BGBG"; break;
ERROR: trailing statements should be on next line
#164: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1440:
+case V4L2_PIX_FMT_SRGGB20:descr = "20-bit Bayer RGRG/GBGB"; break;
total: 4 errors, 2 warnings, 0 checks, 134 lines checked
# Test checkpatch:./0002-media-uapi-videodev2-Add-24-bit-Bayer-formats.patch checkpatch
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#33:
new file mode 100644
WARNING: line length of 199 exceeds 100 columns
#149: FILE: drivers/media/v4l2-core/v4l2-common.c:406:
+{ .format = V4L2_PIX_FMT_SRGGB24,.pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
ERROR: trailing statements should be on next line
#161: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1441:
+case V4L2_PIX_FMT_SBGGR24:descr = "24-bit Bayer BGBG/GRGR"; break;
ERROR: trailing statements should be on next line
#162: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1442:
+case V4L2_PIX_FMT_SGBRG24:descr = "24-bit Bayer GBGB/RGRG"; break;
ERROR: trailing statements should be on next line
#163: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1443:
+case V4L2_PIX_FMT_SGRBG24:descr = "24-bit Bayer GRGR/BGBG"; break;
ERROR: trailing statements should be on next line
#164: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1444:
+case V4L2_PIX_FMT_SRGGB24:descr = "24-bit Bayer RGRG/GBGB"; break;
total: 4 errors, 2 warnings, 0 checks, 134 lines checked
# Test checkpatch:./0003-media-uapi-videodev2-Add-28-bit-Bayer-formats.patch checkpatch
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#33:
new file mode 100644
WARNING: line length of 199 exceeds 100 columns
#149: FILE: drivers/media/v4l2-core/v4l2-common.c:407:
+{ .format = V4L2_PIX_FMT_SRGGB28,.pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
ERROR: trailing statements should be on next line
#161: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1445:
+case V4L2_PIX_FMT_SBGGR28:descr = "28-bit Bayer BGBG/GRGR"; break;
ERROR: trailing statements should be on next line
#162: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1446:
+case V4L2_PIX_FMT_SGBRG28:descr = "28-bit Bayer GBGB/RGRG"; break;
ERROR: trailing statements should be on next line
#163: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1447:
+case V4L2_PIX_FMT_SGRBG28:descr = "28-bit Bayer GRGR/BGBG"; break;
ERROR: trailing statements should be on next line
#164: FILE: drivers/media/v4l2-core/v4l2-ioctl.c:1448:
+case V4L2_PIX_FMT_SRGGB28:descr = "28-bit Bayer RGRG/GBGB"; break;
total: 4 errors, 2 warnings, 0 checks, 134 lines checked
Please fix your series, and upload a new version. If you have a patchwork
account, do not forget to mark the current series as Superseded.
For more details, check the full report at:
https://linux-media.pages.freedesktop.org/-/users/patchwork/-/jobs/11617379… .
Best regards, and Happy Hacking!
Media CI robot on behalf of the linux-media community.
---
Check the latest rules for contributing your patches at:
https://docs.kernel.org/driver-api/media/maintainer-entry-profile.html
If you believe that the CI is wrong, kindly open an issue at
https://gitlab.freedesktop.org/linux-media/media-ci/-/issues or reply-all
to this message.
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] media: v4l2-common: missing 24-bit Bayer formats in
v4l2_format_info()
- [Low] media: Documentation: ambiguous bit alignment in
pixfmt-srggb24.rst
--
commit e6e956a2e4a6d226f09d8783798ca973f5ecc931
Author: Niklas Söderlund <niklas.soderlund+renesas(a)ragnatech.se>
media: uapi: videodev2: Add 24-bit Bayer formats
This commit adds V4L2 pixel format definitions, format descriptions,
v4l2_format_info() support, and documentation for the 24-bit Bayer formats.
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-srggb24.rst b/Documentation/userspace-api/media/v4l/pixfmt-srggb24.rst
> new file mode 100644
> index 0000000000000..7f397dd4a8aa5
> --- /dev/null
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-srggb24.rst
> @@ -0,0 +1,103 @@
[ ... ]
> +Description
> +===========
> +
> +These four pixel formats are raw sRGB / Bayer formats with 24 bits per
> +sample. Each sample is stored in a 32-bit word. Each n-pixel row contains
> +n/2 green samples and n/2 blue or red samples, with alternating red and blue
> +rows. Bytes are stored in memory in little endian order. They are
> +conventionally described as GRGR... BGBG..., RGRG... GBGB..., etc. Below is
> +an example of a small V4L2_PIX_FMT_SBGGR24 image:
> +
> +**Byte Order.**
> +Each cell is one byte.
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> +
> + * - start + 0:
> + - B\ :sub:`00`
> + - B\ :sub:`00`
> + - B\ :sub:`00`
> + - B\ :sub:`00`
[Severity: Low]
Does this leave the bit alignment and padding byte position within each
32-bit word unspecified? Unlike the 10-, 12-, and 14-bit Bayer
specifications, the description does not state whether the 24-bit sample is
stored in the lower 24 bits with the 8 high bits zero-padded, and the byte
order table labels all four byte cells of each 32-bit word identically
without distinguishing the low, middle, and high sample bytes from the
unused padding byte.
[ ... ]
> diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
> index 009721cd25275..e6a37b3ec3d75 100644
> --- a/drivers/media/v4l2-core/v4l2-common.c
> +++ b/drivers/media/v4l2-core/v4l2-common.c
> @@ -403,6 +403,7 @@ const struct v4l2_format_info *v4l2_format_info(u32 format)
> { .format = V4L2_PIX_FMT_SGRBG16, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
> { .format = V4L2_PIX_FMT_SRGGB16, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
> { .format = V4L2_PIX_FMT_SRGGB20, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
> + { .format = V4L2_PIX_FMT_SRGGB24, .pixel_enc = V4L2_PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
[Severity: Medium]
As reported by Jacopo Mondi on v1 [1], should formats[] in
v4l2_format_info() also include V4L2_PIX_FMT_SBGGR24, V4L2_PIX_FMT_SGBRG24,
and V4L2_PIX_FMT_SGRBG24? Without those entries, v4l2_format_info() returns
NULL for the other three 24-bit Bayer color orderings, causing helpers such
as v4l2_fill_pixfmt() and v4l2_fill_pixfmt_mp() to fail with -EINVAL.
[1] https://lore.kernel.org/r/avWRlfslqUKfANte@zed
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261115-v4l2-add-raw-pix-v2-0-f66dd83e5f85@…
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] media: uvcvideo: inaccurate length description in
uvc_video_decode_meta()
--
commit d9c70f01fec4528c54def0726a6851b63764374e
Author: Sinan Turunc <enscrpt(a)pm.me>
media: uvcvideo: Reject metadata packets shorter than their header
This commit rejects UVC metadata headers in uvc_video_decode_meta() when
the passed length is smaller than the standard header length implied by
the PTS and SCR flags.
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index a92a986ab714b..b46db2f97f521 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -1487,6 +1487,10 @@ static void uvc_video_decode_meta(struct uvc_streaming *stream,
> if (has_scr)
> len_std += 6;
>
> + /* A packet shorter than the header it declares is malformed. */
> + if (length < len_std)
> + return;
[Severity: Low]
This isn't a bug in the check itself, but is the description of length in
this comment and the commit message accurate?
Both callers of uvc_video_decode_meta() pass the return value of
uvc_video_decode_start(), which already checks that the USB packet is at
least data[0] bytes long and returns header_len = data[0]:
drivers/media/usb/uvc/uvc_video.c:uvc_video_decode_start() {
...
if (len < 2 || data[0] < 2 || data[0] > len) {
stream->stats.frame.nb_invalid++;
return -EINVAL;
}
header_len = data[0];
...
}
So length in uvc_video_decode_meta() is the declared header length mem[0]
(bHeaderLength), not the packet length, and this check rejects headers
whose declared bHeaderLength is smaller than the standard fields indicated
by their PTS/SCR flags (for example, length == 3 vs len_std == 12 in the
commit message's test case).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261115121701.189-1-enscrpt@pm.me?part=1
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] media: verisilicon: av1: uninitialized or stale mv_offset on
fallback dst buf
- [High] media: verisilicon: stale frame_refs[] in
rockchip_vpu981_av1_dec_ref_buf()
--
commit 9e2909ba573a07ad96d6c1bfd9e63c72c12ba6dc
Author: Arun Iyengar <aiyengar1990(a)gmail.com>
media: verisilicon: av1: Read the segmentation map at the reference's offset
This commit updates rockchip_vpu981_av1_dec_set_segmentation() to use the
reference buffer's stored mv_offset and to only load the primary reference
segmentation map when its dimensions match the current frame.
> 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 59f2adf74850e..f23af435f9619 100644
> --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> @@ -899,15 +899,17 @@ static void rockchip_vpu981_av1_dec_set_segmentation(struct hantro_ctx *ctx)
> if (!!(seg->flags & V4L2_AV1_SEGMENTATION_FLAG_ENABLED) &&
> frame->primary_ref_frame < V4L2_AV1_REFS_PER_FRAME) {
> int idx = rockchip_vpu981_get_frame_index(ctx, frame->primary_ref_frame);
> + int mi_cols = DIV_ROUND_UP(frame->frame_width_minus_1 + 1, 8);
> + int mi_rows = DIV_ROUND_UP(frame->frame_height_minus_1 + 1, 8);
>
> - if (idx >= 0) {
> + if (idx >= 0 && av1_dec->frame_refs[idx].mi_cols == mi_cols &&
> + av1_dec->frame_refs[idx].mi_rows == mi_rows) {
[Severity: High]
Can av1_dec->frame_refs[idx] disagree with the buffer actually returned by
rockchip_vpu981_av1_dec_ref_buf()?
hantro_stop_streaming() only calls codec_ops->exit() on the coded OUTPUT
queue, and rockchip_vpu981_av1_dec_clean_refs() only checks whether a
timestamp is still listed in frame->reference_frame_ts[], while
rockchip_vpu981_av1_dec_frame_ref() allocates new frame_refs[] slots
without deduplicating timestamps:
drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:rockchip_vpu981_av1_dec_ref_buf() {
if (idx >= 0 && av1_dec->frame_refs[idx].used)
buf = vb2_find_buffer(q, av1_dec->frame_refs[idx].timestamp);
return buf ?: &hantro_get_dst_buf(ctx)->vb2_buf;
}
If the CAPTURE queue is reallocated or a buffer is removed via
VIDIOC_REMOVE_BUFS while its timestamp remains in reference_frame_ts[], or
if a smaller CAPTURE buffer reuses that timestamp, frame_refs[idx] still
holds the old dimensions while rockchip_vpu981_av1_dec_ref_buf() returns
either the fallback destination buffer or the smaller buffer, programming
AV1_SEGMENTATION (and the reference dimensions in
rockchip_vpu981_av1_dec_set_reference_frames()) to read past the end of
the buffer.
> dma_addr_t luma_addr, mv_addr = 0;
> struct hantro_decoded_buffer *seg;
> - size_t mv_offset = rockchip_vpu981_av1_dec_chroma_size(ctx);
>
> seg = vb2_to_hantro_decoded_buf(rockchip_vpu981_av1_dec_ref_buf(ctx, idx));
> luma_addr = hantro_get_dec_buf_addr(ctx, &seg->base.vb.vb2_buf);
> - mv_addr = luma_addr + mv_offset;
> + mv_addr = luma_addr + seg->av1.mv_offset;
[Severity: High]
Does this read seg->av1.mv_offset before it has been initialized when
rockchip_vpu981_av1_dec_ref_buf() returns the current destination buffer?
In rockchip_vpu981_av1_dec_run(), rockchip_vpu981_av1_dec_frame_ref(),
rockchip_vpu981_av1_dec_set_reference_frames() and
rockchip_vpu981_av1_dec_set_segmentation() all run before
rockchip_vpu981_av1_dec_set_output_buffer(), which is the only place that
sets dst->av1.chroma_offset and dst->av1.mv_offset:
drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:rockchip_vpu981_av1_dec_run() {
...
rockchip_vpu981_av1_dec_frame_ref(ctx);
...
rockchip_vpu981_av1_dec_set_reference_frames(ctx);
rockchip_vpu981_av1_dec_set_segmentation(ctx);
...
rockchip_vpu981_av1_dec_set_output_buffer(ctx);
}
Whenever rockchip_vpu981_av1_dec_ref_buf() falls back to
hantro_get_dst_buf(ctx) (or matches the current job's timestamp already
recorded by rockchip_vpu981_av1_dec_frame_ref()), seg->av1.mv_offset (as
well as dst->av1.chroma_offset and dst->av1.mv_offset in
rockchip_vpu981_av1_dec_set_ref() from commit "media: verisilicon: av1:
Find the reference buffers by timestamp") is either 0 on a fresh CAPTURE
buffer or holds a stale offset from an earlier format, which can point the
VPU DMA past the end of a smaller buffer.
Calling rockchip_vpu981_av1_dec_set_output_buffer() before setting up
reference frames and segmentation would ensure the destination buffer's
offsets are always populated first.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261115-b4-vpu981-av1-refs-v1-0-c65769715db…
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] media: verisilicon: uninitialized offsets in
rockchip_vpu981_av1_dec_set_ref()
- [Medium] media: verisilicon: wrong fallback size in
rockchip_vpu981_av1_dec_set_ref()
- [Low] media: verisilicon: unused current_frame_index in
hantro_av1_dec_hw_ctx
--
commit 8a04a8a4d7029414da29721278a178bcecbd2b54
Author: Arun Iyengar <aiyengar1990(a)gmail.com>
media: verisilicon: av1: Find the reference buffers by timestamp
This commit replaces the stored vb2_v4l2_buffer pointer in
hantro_av1_frame_ref with a per-job timestamp lookup via
vb2_find_buffer(), falling back to the current destination buffer when a
reference is missing.
> 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 2a145433e6d17..59f2adf74850e 100644
> --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> @@ -169,7 +169,6 @@ static int rockchip_vpu981_av1_dec_frame_ref(struct hantro_ctx *ctx,
> av1_dec->frame_refs[i].timestamp = timestamp;
> av1_dec->frame_refs[i].frame_type = frame->frame_type;
> av1_dec->frame_refs[i].order_hint = frame->order_hint;
> - av1_dec->frame_refs[i].vb2_ref = hantro_get_dst_buf(ctx);
>
> for (j = 0; j < V4L2_AV1_TOTAL_REFS_PER_FRAME; j++)
> av1_dec->frame_refs[i].order_hints[j] = frame->order_hints[j];
> @@ -182,6 +181,18 @@ static int rockchip_vpu981_av1_dec_frame_ref(struct hantro_ctx *ctx,
> return AV1_INVALID_IDX;
> }
>
> +static struct vb2_buffer *rockchip_vpu981_av1_dec_ref_buf(struct hantro_ctx *ctx, int idx)
> +{
> + struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
> + struct vb2_queue *q = v4l2_m2m_get_dst_vq(ctx->fh.m2m_ctx);
> + struct vb2_buffer *buf = NULL;
> +
> + if (idx >= 0 && av1_dec->frame_refs[idx].used)
> + buf = vb2_find_buffer(q, av1_dec->frame_refs[idx].timestamp);
> +
> + return buf ?: &hantro_get_dst_buf(ctx)->vb2_buf;
> +}
> +
> static void rockchip_vpu981_av1_dec_frame_unref(struct hantro_ctx *ctx, int idx)
> {
> struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
> @@ -829,7 +840,7 @@ rockchip_vpu981_av1_dec_set_ref(struct hantro_ctx *ctx, int ref, int idx,
> pr_warn("AV1 invalid reference frame index\n");
> }
>
> - dst = vb2_to_hantro_decoded_buf(&av1_dec->frame_refs[idx].vb2_ref->vb2_buf);
> + dst = vb2_to_hantro_decoded_buf(rockchip_vpu981_av1_dec_ref_buf(ctx, idx));
> luma_addr = hantro_get_dec_buf_addr(ctx, &dst->base.vb.vb2_buf);
> chroma_addr = luma_addr + dst->av1.chroma_offset;
> mv_addr = luma_addr + dst->av1.mv_offset;
[Severity: Medium]
When rockchip_vpu981_av1_dec_ref_buf() falls back to
hantro_get_dst_buf(ctx), doesn't rockchip_vpu981_av1_dec_set_ref() read
dst->av1.chroma_offset and dst->av1.mv_offset before they are initialized
for the current job?
In rockchip_vpu981_av1_dec_run(),
rockchip_vpu981_av1_dec_set_reference_frames() runs before
rockchip_vpu981_av1_dec_set_output_buffer() sets dst->av1.chroma_offset
and dst->av1.mv_offset:
drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:rockchip_vpu981_av1_dec_run() {
...
rockchip_vpu981_av1_dec_set_reference_frames(ctx);
rockchip_vpu981_av1_dec_set_segmentation(ctx);
...
rockchip_vpu981_av1_dec_set_output_buffer(ctx);
...
}
When a reference slot is unused (idx is AV1_INVALID_IDX), allow_intrabc
is set, or a reference buffer was removed, the fallback uses the current
capture buffer while its offsets are still zero (aliasing luma_addr for
AV1_REFERENCE_CB and AV1_REFERENCE_MV) or hold stale values from a
previous format. Calling rockchip_vpu981_av1_dec_set_output_buffer()
before rockchip_vpu981_av1_dec_set_reference_frames() would ensure the
current destination buffer's offsets are populated first.
[ ... ]
> @@ -1983,16 +1994,13 @@ static void rockchip_vpu981_av1_dec_set_reference_frames(struct hantro_ctx *ctx)
>
> for (i = V4L2_AV1_REF_LAST_FRAME; i < V4L2_AV1_TOTAL_REFS_PER_FRAME; i++) {
> u32 ref = i - 1;
> - int idx = 0;
> - int width, height;
> + int idx = AV1_INVALID_IDX;
> + int width = frame->frame_width_minus_1 + 1;
> + int height = frame->frame_height_minus_1 + 1;
>
> - if (allow_intrabc) {
> - idx = av1_dec->current_frame_index;
> - width = frame->frame_width_minus_1 + 1;
> - height = frame->frame_height_minus_1 + 1;
> - } else {
> - if (rockchip_vpu981_get_frame_index(ctx, ref) > 0)
> - idx = rockchip_vpu981_get_frame_index(ctx, ref);
> + if (!allow_intrabc)
> + idx = rockchip_vpu981_get_frame_index(ctx, ref);
> + if (idx >= 0) {
> width = av1_dec->frame_refs[idx].width;
> height = av1_dec->frame_refs[idx].height;
> }
[Severity: Medium]
If a reference buffer is removed via VIDIOC_REMOVE_BUFS while its
timestamp is still in frame->reference_frame_ts[], won't this still
program the old reference's width and height alongside the fallback
capture buffer?
rockchip_vpu981_get_frame_index() only checks av1_dec->frame_refs[], so
it returns idx >= 0 and this loop uses av1_dec->frame_refs[idx].width
and height, even though vb2_find_buffer() in
rockchip_vpu981_av1_dec_ref_buf() returns NULL and falls back to the
current destination buffer. If the removed reference had larger
dimensions than the current capture buffer, the hardware can read past
the end of the fallback buffer.
> @@ -2185,16 +2193,13 @@ rockchip_vpu981_av1_dec_set_input_buffer(struct hantro_ctx *ctx,
> static void
> rockchip_vpu981_av1_dec_set_output_buffer(struct hantro_ctx *ctx)
> {
> - struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
> struct hantro_dev *vpu = ctx->dev;
> struct hantro_decoded_buffer *dst;
> - struct vb2_v4l2_buffer *vb2_dst;
> dma_addr_t luma_addr, chroma_addr, mv_addr = 0;
> size_t cr_offset = rockchip_vpu981_av1_dec_luma_size(ctx);
> size_t mv_offset = rockchip_vpu981_av1_dec_chroma_size(ctx);
>
> - vb2_dst = av1_dec->frame_refs[av1_dec->current_frame_index].vb2_ref;
> - dst = vb2_to_hantro_decoded_buf(&vb2_dst->vb2_buf);
> + dst = vb2_to_hantro_decoded_buf(&hantro_get_dst_buf(ctx)->vb2_buf);
> luma_addr = hantro_get_dec_buf_addr(ctx, &dst->base.vb.vb2_buf);
> chroma_addr = luma_addr + cr_offset;
> mv_addr = luma_addr + mv_offset;
[Severity: Low]
This isn't a bug, but with both uses of av1_dec->current_frame_index
removed here and in rockchip_vpu981_av1_dec_set_reference_frames(),
current_frame_index in struct hantro_av1_dec_hw_ctx is now only ever
written to in rockchip_vpu981_av1_dec_frame_ref() and can be dropped as
well.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261115-b4-vpu981-av1-refs-v1-0-c65769715db…
Dear Arun Iyengar via B4 Relay:
Thanks for your patches! Unfortunately the Media CI robot detected some
issues:
# Test checkpatch:./0002-media-rkvdec-Stop-the-VDPU381-core-on-timeout.patch checkpatch
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#11:
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: cpu_suspend+0x380/0x3d0
total: 0 errors, 1 warnings, 0 checks, 146 lines checked
Please fix your series, and upload a new version. If you have a patchwork
account, do not forget to mark the current series as Superseded.
For more details, check the full report at:
https://linux-media.pages.freedesktop.org/-/users/patchwork/-/jobs/11615025… .
Best regards, and Happy Hacking!
Media CI robot on behalf of the linux-media community.
---
Check the latest rules for contributing your patches at:
https://docs.kernel.org/driver-api/media/maintainer-entry-profile.html
If you believe that the CI is wrong, kindly open an issue at
https://gitlab.freedesktop.org/linux-media/media-ci/-/issues or reply-all
to this message.