All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Esben Haabendal" <esben@geanix.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing
Date: Mon, 03 Aug 2026 15:18:57 +0000	[thread overview]
Message-ID: <20260803151858.49ABB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803-nwl-dsi-fixes-v2-3-1809a0ac453f@geanix.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] 64-bit division using the '/' operator causes a linker error on 32-bit architectures.
--

--- Patch [3]: [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing ---
commit 2e5ea2d668a183af376a6de9dd60e558786a8b7f
Author: Esben Haabendal <esben@geanix.com>

drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing

This commit corrects the horizontal sync timing for the NWL MIPI Host
controller by calculating the hfp, hsa, and hbp in DSI packet payload size in
bytes instead of pixel clocks. It implements the calculation based on the
i.MX 8M reference manual while also taking the packet header size into account.

> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> index c9af6a3d47e1d..226036d22e3f8 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
[ ... ]
> @@ -317,9 +322,62 @@ static int nwl_dsi_config_dpi(struct nwl_dsi *dsi)
>  			      dsi->mode.hdisplay);
>  	}
>  
> -	nwl_dsi_write(dsi, NWL_DSI_HFP, hfront_porch);
> -	nwl_dsi_write(dsi, NWL_DSI_HBP, hback_porch);
> -	nwl_dsi_write(dsi, NWL_DSI_HSA, hsync_len);
> +	pclk_period = DIV_ROUND_UP_ULL(PSEC_PER_SEC, dsi->mode.clock * 1000);
> +	DRM_DEV_DEBUG_DRIVER(dsi->dev, "pclk_period: %llu\n", pclk_period);
> +
> +	hs_period = DIV_ROUND_UP_ULL(PSEC_PER_SEC, dsi->phy_cfg.mipi_dphy.hs_clk_rate);
> +	DRM_DEV_DEBUG_DRIVER(dsi->dev, "hs_period: %llu\n", hs_period);
> +
> +	/*
> +	 * Calculate the bytes needed, according to the RM formula:
> +	 * Time of DPI event = time to transmit x number of bytes on the DSI
> +	 * interface
> +	 * dpi_event_size * dpi_pclk_period = dsi_bytes * 8 * hs_bit_period /
> +	 * num_lanes
> +	 * ===>
> +	 * dsi_bytes = dpi_event_size * dpi_pclk_period * num_lanes /
> +	 * (8 * hs_bit_period)
> +	 */
> +	hfp = hfront_porch * pclk_period * dsi->lanes / (8 * hs_period);
> +	hbp = hback_porch * pclk_period * dsi->lanes / (8 * hs_period);
> +	hsa = hsync_len * pclk_period * dsi->lanes / (8 * hs_period);

[Severity: Low]
Since hs_period and pclk_period are unsigned long long, does using the direct
'/' operator for 64-bit division cause a linker error (such as undefined
reference to __udivdi3) when building for 32-bit architectures?

Could this be resolved by using standard kernel 64-bit division macros such as
div64_u64() instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260803-nwl-dsi-fixes-v2-0-1809a0ac453f@geanix.com?part=3

  reply	other threads:[~2026-08-03 15:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 14:56 [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override Esben Haabendal
2026-08-05  8:36   ` Luca Ceresoli
2026-08-05 12:56     ` Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 2/4] drm/bridge: nwl-dsi: Correct auto-insert EOTP behavior Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing Esben Haabendal
2026-08-03 15:18   ` sashiko-bot [this message]
2026-08-03 14:56 ` [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set() Esben Haabendal
2026-08-03 15:28   ` sashiko-bot
2026-08-05  8:36   ` Luca Ceresoli
2026-08-05 12:58     ` Esben Haabendal

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=20260803151858.49ABB1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=esben@geanix.com \
    --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 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.