All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wenmeng Liu" <wenmeng.liu@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH 4/6] media: qcom: camss: vfe: Add support for VFE 900
Date: Tue, 15 Sep 2026 09:43:38 +0000	[thread overview]
Message-ID: <20260915094338.CEAA41F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915-nord-v1-4-20db41a7f1ff@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] media: camss: incorrect FRAME_INCR address shift for VFE 900
--

commit dd5f8f2cb07db9a03dde1f94e9ccbfb47aa55597
Author: Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>

media: qcom: camss: vfe: Add support for VFE 900

This commit introduces support for the VFE 900 hardware variant on the Nord
platform. It adds a new configuration structure to handle register base
differences and updates the image address shift in vfe_wm_update().

> diff --git a/drivers/media/platform/qcom/camss/camss-vfe-gen4.c b/drivers/media/platform/qcom/camss/camss-vfe-gen4.c
> index d73d70898710a..f1429a6d2be54 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe-gen4.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe-gen4.c

[ ... ]

> @@ -83,18 +147,36 @@
>   * RDI3			3
>   * GAMMA		4
>   * STATES_BE		5
> + *
> + * v900 full IFE write master client map: the RDI clients start at 28,
> + * after the 28 image/stats clients (0-27):
> + *
> + * MAIN C0/C1/C2/UV		0-3
> + * PIXEL_RAW			4
> + * W_IR				5
> + * AI_1 C0/C1/C2/UV		6-9
> + * AI_2 C0/C1/C2/UV		10-13
> + * HV_DS16 / HV_DS4		14-15
> + * STATS BG_IR..BLTM		16-27
> + * RDI0				28
> + * RDI1				29
> + * RDI2				30
> + * ... RDI11			39
> + *
> + * v900 IFE Lite matches the generic map above (RDI0 at client 0).
>   */
> -#define RDI_WM(n) ((vfe_is_lite(vfe) ? 0x0 : 0x17) + (n))
>  
>  static void vfe_wm_start(struct vfe_device *vfe, u8 wm, struct vfe_line *line)
>  {
>  	struct v4l2_pix_format_mplane *pix =
>  		&line->video_out.active_fmt.fmt.pix_mp;
>  
> -	wm = RDI_WM(wm);
> +	wm = vfe_gen4_rdi_wm(vfe, wm);
>  
>  	/* no clock gating at bus input */
> -	writel(WM_CGC_OVERRIDE_ALL, vfe->base + VFE_BUS_WM_CGC_OVERRIDE);
> +	if (vfe_gen4_get_hw_info(vfe)->has_wm_cgc_override)
> +		writel(WM_CGC_OVERRIDE_ALL,
> +		       vfe->base + VFE_BUS_WM_CGC_OVERRIDE);
>  
>  	writel(0x0, vfe->base + VFE_BUS_WM_TEST_BUS_CTRL);
>  

[Severity: High]
Should VFE_BUS_WM_FRAME_INCR also be updated to use the new addr_shift?

Just below this in vfe_wm_start(), the frame increment is still
hardcoded to shift by 8:

	writel(ALIGN(pix->plane_fmt[0].bytesperline, 16) * pix->height >> 8,
	       vfe->base + VFE_BUS_WM_FRAME_INCR(wm));

Since VFE 900 uses an addr_shift of 0, leaving this hardcoded shift means
the frame increment will be 256 times smaller than required. During
multi-frame captures on VFE 900, will subsequent frames be written to
incorrect offsets and overwrite previous frame data?

[ ... ]

> @@ -123,15 +205,19 @@ static void vfe_wm_start(struct vfe_device *vfe, u8 wm, struct vfe_line *line)
>  
>  static void vfe_wm_stop(struct vfe_device *vfe, u8 wm)
>  {
> -	wm = RDI_WM(wm);
> +	wm = vfe_gen4_rdi_wm(vfe, wm);
>  	writel(0, vfe->base + VFE_BUS_WM_CFG(wm));
>  }
>  
>  static void vfe_wm_update(struct vfe_device *vfe, u8 wm, u32 addr,
>  			  struct vfe_line *line)
>  {
> -	wm = RDI_WM(wm);
> -	writel(addr >> 8, vfe->base + VFE_BUS_WM_IMAGE_ADDR(wm));
> +	const struct vfe_gen4_hw_info *hw_info = vfe_gen4_get_hw_info(vfe);
> +
> +	wm = vfe_gen4_rdi_wm(vfe, wm);
> +
> +	writel(addr >> hw_info->addr_shift,
> +	       vfe->base + VFE_BUS_WM_IMAGE_ADDR(wm));
>  
>  	dev_dbg(vfe->camss->dev, "wm:%d, image buf addr:0x%x\n", wm, addr);
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915-nord-v1-0-20db41a7f1ff@oss.qualcomm.com?part=4

  reply	other threads:[~2026-09-15  9:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  9:34 [PATCH 0/6] media: qcom: camss: Add support for Nord CAMSS Wenmeng Liu
2026-09-15  9:34 ` [PATCH 1/6] dt-bindings: media: Add bindings for qcom,nord-camss Wenmeng Liu
2026-09-15  9:45   ` sashiko-bot
2026-09-17 10:13   ` Krzysztof Kozlowski
2026-09-17 12:37     ` Wenmeng Liu
2026-09-18  6:47       ` Krzysztof Kozlowski
2026-09-18  7:08         ` Wenmeng Liu
2026-09-15  9:34 ` [PATCH 2/6] media: qcom: camss: csid: Add support for CSID 900 Wenmeng Liu
2026-09-15  9:50   ` sashiko-bot
2026-09-20  7:01   ` Shawn Guo
2026-09-15  9:34 ` [PATCH 3/6] media: qcom: camss: vfe: Add support for VFE gen4 Wenmeng Liu
2026-09-15  9:53   ` sashiko-bot
2026-09-20  7:19   ` Shawn Guo
2026-09-15  9:34 ` [PATCH 4/6] media: qcom: camss: vfe: Add support for VFE 900 Wenmeng Liu
2026-09-15  9:43   ` sashiko-bot [this message]
2026-09-20  7:17   ` Shawn Guo
2026-09-15  9:34 ` [PATCH 5/6] media: qcom: camss: tpg: Add support for TPG v2.5.0 Wenmeng Liu
2026-09-15  9:34 ` [PATCH 6/6] media: qcom: camss: Add support for nord camss Wenmeng Liu
     [not found] ` <6aa92fc5.2eca3aba.387881.68f4@mx.google.com>
2026-09-16  2:57   ` [0/6] media: qcom: camss: Add support for Nord CAMSS Wenmeng Liu
2026-09-17 10:57     ` Bryan O'Donoghue
2026-09-17 12:39       ` Wenmeng Liu

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=20260915094338.CEAA41F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wenmeng.liu@oss.qualcomm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.