Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nas Chung" <nas.chung@chipsnmedia.com>
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev, robh@kernel.org,
	conor+dt@kernel.org, Frank.Li@kernel.org, media-ci@linuxtv.org
Subject: Re: [PATCH v8 06/11] media: chips-media: wave6: Add Wave6 encoder firmware interface
Date: Thu, 19 Nov 2026 09:10:18 +0000	[thread overview]
Message-ID: <sashiko-outbox-222793@kernel.org> (raw)
In-Reply-To: <85ce28c44e167aa05ffc19dc02ce2be26dd99893.1795075581.git.nas.chung@chipsnmedia.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] media: wave6: avoid large struct copies on stack in
  wave6_gen_enc_pic_reg()
--

commit 0c77c50267143f16a1d2daf6f5d24a657e85b50e
Author: Nas Chung <nas.chung@chipsnmedia.com>

media: chips-media: wave6: Add Wave6 encoder firmware interface

This commit adds the firmware interface and MMIO register configuration
helpers for Wave6 video encoding operations.

> diff --git a/drivers/media/platform/chips-media/wave6/wave6-hw.c b/drivers/media/platform/chips-media/wave6/wave6-hw.c
> index 872a540df0218..171391f797cb8 100644
> --- a/drivers/media/platform/chips-media/wave6/wave6-hw.c
> +++ b/drivers/media/platform/chips-media/wave6/wave6-hw.c
[ ... ]
> +static void wave6_update_enc_info(struct enc_info *p_enc_info)
> +{
> +	struct enc_open_param op = p_enc_info->open_param;
> +
> +	p_enc_info->width = op.pic_width;
> +	p_enc_info->height = op.pic_height;
> +	p_enc_info->c_fmt_idc = get_chroma_format_idc(op.out_fmt);
> +}
[ ... ]
> +static void wave6_gen_enc_pic_reg(struct enc_info *p_enc_info, bool cbcr_interleave, bool nv21,
> +				  struct enc_param *opt, struct enc_cmd_enc_pic_reg *reg)
> +{
> +	struct enc_open_param open = p_enc_info->open_param;
> +	struct enc_codec_param param = open.codec_param;
> +	u32 stride_c = opt->source_frame->stride_c;
> +	u32 c_fmt_idc;
[ ... ]
> +int wave6_vpu_enc_start_one_frame(struct vpu_instance *inst, struct enc_param *param,
> +				  u32 *fail_res)
> +{
> +	struct enc_cmd_enc_pic_reg reg = {};
> +	struct enc_info *p_enc_info;
> +	int ret;
> +
> +	guard(mutex)(&inst->dev->hw_lock);
> +
> +	p_enc_info = &inst->codec_info->enc_info;
> +
> +	wave6_gen_enc_pic_reg(p_enc_info, inst->cbcr_interleave,
> +			      inst->nv21, param, &reg);

[Severity: Medium]
Should wave6_gen_enc_pic_reg() and wave6_update_enc_info() take pointers
to p_enc_info->open_param and its codec_param instead of copying them by
value onto the stack?

struct enc_open_param is around 824 bytes and struct enc_codec_param is
around 772 bytes.  When wave6_gen_enc_pic_reg() is inlined into
wave6_vpu_enc_start_one_frame() alongside struct enc_cmd_enc_pic_reg, the
local structures alone consume roughly 1,700 bytes of stack space (and
over 1,220 bytes in wave6_vpu_enc_issue_seq_init() via
wave6_update_enc_info()), exceeding the 1,280-byte CONFIG_FRAME_WARN
threshold on 32-bit builds.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795075577.git.nas.chung@chipsnmedia.com?part=6

  reply	other threads:[~2026-11-19  9:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  8:59 [PATCH v8 00/11] Add support for Wave6 video codec driver Nas Chung
2026-11-19  8:59 ` [PATCH v8 01/11] dt-bindings: media: nxp: Add Wave6 video codec device Nas Chung
2026-11-19  8:59 ` [PATCH v8 02/11] media: chips-media: wave6: Add Wave6 control driver Nas Chung
2026-11-19  8:59 ` [PATCH v8 03/11] media: chips-media: wave6: Add Wave6 core driver Nas Chung
2026-11-19  8:59 ` [PATCH v8 04/11] media: chips-media: wave6: Add Wave6 decoder firmware interface Nas Chung
2026-11-19  9:22   ` sashiko-bot
2026-11-19  8:59 ` [PATCH v8 05/11] media: chips-media: wave6: Add Wave6 m2m decoder Nas Chung
2026-11-19  9:00 ` [PATCH v8 06/11] media: chips-media: wave6: Add Wave6 encoder firmware interface Nas Chung
2026-11-19  9:10   ` sashiko-bot [this message]
2026-11-19  9:00 ` [PATCH v8 07/11] media: chips-media: wave6: Add Wave6 m2m encoder Nas Chung
2026-11-19  9:00 ` [PATCH v8 08/11] media: chips-media: wave6: Add trace and debugfs Nas Chung
2026-11-19  9:14   ` sashiko-bot
2026-11-19  9:00 ` [PATCH v8 09/11] media: chips-media: wave6: Add performance profiling Nas Chung
2026-11-19  9:20   ` sashiko-bot
2026-11-19  9:00 ` [PATCH v8 10/11] media: chips-media: wave6: Add Wave6 thermal cooling device Nas Chung
2026-11-19  9:21   ` sashiko-bot
2026-11-19  9:00 ` [PATCH v8 11/11] arm64: dts: freescale: imx95: Add video codec node Nas Chung

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-222793@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=media-ci@linuxtv.org \
    --cc=nas.chung@chipsnmedia.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