Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 15/18] media: iris: Introduce buffer size calculations for AR50LT
Date: Tue, 07 Jul 2026 22:50:33 +0000	[thread overview]
Message-ID: <20260707225033.9E5741F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708-iris-ar50lt-v6-15-374f0a46c23b@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] VP9 AR50LT line buffer calculation is missing size_vpxd_lb_fe_top_ctrl, size_vpxd_lb_recon_dma_metadata_wr, and size_vp9d_qp.
- [High] Missing SIZE_SEI_USERDATA allocation in hfi_buffer_persist_h264d_ar50lt.
--

--- Patch [15]: [PATCH v6 15/18] media: iris: Introduce buffer size calculations for AR50LT ---
commit 21a2756943f587f0146e1fc640977667f461e12f
Author: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>

media: iris: Introduce buffer size calculations for AR50LT

This commit introduces AR50LT buffer size calculations for both the encoder
and decoder. It reuses the buffer size calculations which are common, while
adding the AR50LT specific ones separately.

> diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> index 511502d4ea6c3..00dbb091c54ef 100644
> --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
[ ... ]
> @@ -230,6 +328,11 @@ static u32 hfi_buffer_persist_h264d(void)
>  		    DMA_ALIGNMENT);
>  }
>  
> +static u32 hfi_buffer_persist_h264d_ar50lt(void)
> +{
> +	return ALIGN((SIZE_SLIST_BUF_H264 * NUM_SLIST_BUF_H264), DMA_ALIGNMENT);
> +}
> +

[Severity: High]
Does this code omit the NUM_HW_PIC_BUF * SIZE_SEI_USERDATA allocation?

The original hfi_buffer_persist_h264d() includes this allocation for SEI
metadata, and the HEVC equivalent for AR50LT retains it as well.

Could omitting this cause the firmware to write out of bounds when parsing
H.264 bitstreams with SEI messages?

[ ... ]
> @@ -492,6 +689,17 @@ u32 hfi_iris3_vp9d_lb_size(u32 frame_width, u32 frame_height, u32 num_vpp_pipes)
>  		ALIGN(size_vp9d_qp(frame_width, frame_height), DMA_ALIGNMENT);
>  }
>  
> +static inline
> +u32 hfi_buffer_line_vp9d_ar50lt(u32 frame_width, u32 frame_height, u32 _yuv_bufcount_min)
> +{
> +	return ALIGN(size_vpxd_lb_fe_left_ctrl(frame_width, frame_height), DMA_ALIGNMENT) +
> +		ALIGN(size_vpxd_lb_se_left_ctrl_ar50lt(frame_width, frame_height), DMA_ALIGNMENT) +
> +		ALIGN(size_vp9d_lb_vsp_top(frame_width, frame_height), DMA_ALIGNMENT) +
> +		ALIGN(size_vpxd_lb_se_top_ctrl(frame_width, frame_height), DMA_ALIGNMENT) +
> +		ALIGN(size_vp9d_lb_pe_top_data(frame_width, frame_height), DMA_ALIGNMENT) +
> +		ALIGN(size_vp9d_lb_fe_top_data(frame_width, frame_height), DMA_ALIGNMENT);
> +}
> +

[Severity: High]
Is this calculation missing size_vpxd_lb_fe_top_ctrl(),
size_vpxd_lb_recon_dma_metadata_wr(), and size_vp9d_qp()?

These sizes were included in the previous generation's VP9 line buffer
calculation in hfi_iris3_vp9d_lb_size(). The AR50LT versions for H.264
and HEVC also retain their direct equivalents.

Could omitting them result in an undersized DMA allocation, leading to memory
corruption when the firmware writes past the end of the line buffer?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260708-iris-ar50lt-v6-0-374f0a46c23b@oss.qualcomm.com?part=15

  reply	other threads:[~2026-07-07 22:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 22:28 [PATCH v6 00/18] media: iris: Add AR50LT core support and enable Agatti platform Dmitry Baryshkov
2026-07-07 22:28 ` [PATCH v6 01/18] media: iris: Add Gen2 firmware autodetect and fallback Dmitry Baryshkov
2026-07-07 22:46   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 02/18] media: iris: Skip UBWC configuration when not supported Dmitry Baryshkov
2026-07-07 22:28 ` [PATCH v6 03/18] media: iris: drop IRIS_FMT_foo enumeration Dmitry Baryshkov
2026-07-08  5:32   ` Vikash Garodia
2026-07-07 22:28 ` [PATCH v6 04/18] media: iris: Filter UBWC raw formats based on hardware capabilities Dmitry Baryshkov
2026-07-07 22:45   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 05/18] media: iris: Introduce set_preset_register as a vpu_op Dmitry Baryshkov
2026-07-07 22:28 ` [PATCH v6 06/18] media: iris: Introduce interrupt_init " Dmitry Baryshkov
2026-07-07 22:28 ` [PATCH v6 07/18] media: iris: add vpu op hook to disable ARP buffer Dmitry Baryshkov
2026-07-07 22:28 ` [PATCH v6 08/18] media: iris: Add platform data field for watchdog interrupt mask Dmitry Baryshkov
2026-07-07 22:28 ` [PATCH v6 09/18] media: iris: Add platform flag for instantaneous bandwidth voting Dmitry Baryshkov
2026-07-07 22:46   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 10/18] media: iris: skip PIPE if it is not supported by the platform Dmitry Baryshkov
2026-07-07 22:57   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 11/18] media: iris: Add framework support for AR50_LITE video core Dmitry Baryshkov
2026-07-07 22:42   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 12/18] media: iris: add minimal GET_PROPERTY implementation Dmitry Baryshkov
2026-07-07 22:50   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 13/18] media: iris: update buffer requirements based on received info Dmitry Baryshkov
2026-07-07 22:49   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 14/18] media: iris: implement support for the Agatti platform Dmitry Baryshkov
2026-07-07 22:53   ` sashiko-bot
2026-07-07 22:28 ` [PATCH v6 15/18] media: iris: Introduce buffer size calculations for AR50LT Dmitry Baryshkov
2026-07-07 22:50   ` sashiko-bot [this message]
2026-07-07 22:28 ` [PATCH v6 16/18] media: iris: add Gen2 firmware support on the Agatti platform Dmitry Baryshkov
2026-07-07 22:29 ` [PATCH v6 17/18] media: venus: skip QCM2290 if Iris driver is enabled Dmitry Baryshkov
2026-07-07 22:50   ` sashiko-bot
2026-07-07 22:29 ` [PATCH v6 18/18] media: iris: constify inst_fw_cap_sm8250_dec Dmitry Baryshkov

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=20260707225033.9E5741F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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